Conversation
|
richard-jones
left a comment
There was a problem hiding this comment.
Some structural changes, and a question about why a change to the core of edges, and a request to roll that back and submit it as a PR
portality/lib/urlshort.py
Outdated
There was a problem hiding this comment.
From a code organisation perspective, I'd like this to be a ShortURLService in portality.bll rather than in portality.lib and to follow the usual service pattern
There was a problem hiding this comment.
move it to portality.bll should be fine.
About usual service pattern,
portality.bll.doaj.shortUrlService() should already resolve circle import problem, class a less flexible and complex than simple module file.
what is the benefit to make service as a class ?
There was a problem hiding this comment.
There are a couple of reasons it's a class: one is just style preference, the other is that services can then be instantiated with arguments if needed, to enable alternative behaviours in different contexts (e.g. testing).
There was a problem hiding this comment.
I'm unsure what's happening here, is this just an update to the latest edges develop branch? I can see at least one commit from a username I don't recognise in the edges develop branch, that needs to be rolled back and submitted as PR at least, because I don't see how a change to the URL shortener that DOAJ uses requires a core edges change (it shouldn't).
There was a problem hiding this comment.
yes, I just update develop branch because I don't know the procedure of update submodule . That user name was my default name.
Reason of changing edges is because generateShortUrl only passing query to url shortener handler , logic of the value that showing in textbox and value that used to generate shortened url are different. That easy to making mismatch in what the user see and what actually generated.
There was a problem hiding this comment.
here is edges PR
richard-jones
left a comment
There was a problem hiding this comment.
Some architectural changes still
portality/bll/services/urlshort.py
Outdated
There was a problem hiding this comment.
This file should be structured the same as the other services, for code style consistency
There was a problem hiding this comment.
class have a lot of problem because it is stateful which mean high coupling, to make a program more simple I prefer not using class except the design need it.
functions in urlshort are no relation and independence each other.
about code style consistency, if you check javascript files, some components are start defined with class now instead of transitional function. If you read python build-in library, every module implemented in different style but build-in library still maintain very well.
So, Sorry but I will not update it if no other reason.
| if (!this.component.shortUrl) { | ||
| var callback = edges.objClosure(this, "updateShortUrl"); | ||
| this.component.generateShortUrl(callback); | ||
| this.component.generateShortUrl(this.component.edge.fullUrl(), callback); |
There was a problem hiding this comment.
I've had a look at the downstream change to edges that this introduces, and we can't accept it. It changes the URL shortening approach, which will have downstream consequences for other users/projects. I'm not sure why you need to put this fullUrl cal here, edges can figure out the full url and ensure that there are no unwanted elements, so we should just leave this as it was.
There was a problem hiding this comment.
We won't merge this change on edges, as noted above: it could cause problems for other users of the library, and takes away edges ability to control the URL. It's not a generic url shortener, it's specifically for creating short versions of edges urls, which means that internally it knows better how to generate them.
…007_remove_the_seal
…007_remove_the_seal # Conflicts: # doajtest/unit/application_processors/test_maned_journal_review.py # portality/forms/application_forms.py # portality/forms/application_processors.py # portality/static/js/doaj.fieldrender.edges.js # portality/templates-v2/public/layouts/toc.html
… in the data models, and remove the orcid and open citations elements. Also updates all the related tests, plus fixes some tests that appear broken in devleop
richard-jones
left a comment
There was a problem hiding this comment.
In an attempt to fix some unrelated broken tests I have merged develop and also issue 4007. This has not completely resolved the issue, and makes this dependent on merging the seal code now
[2881] Make our own short URLs
Please don't delete any sections when completing this PR template; instead enter N/A for checkboxes or sections which are not applicable, unless otherwise stated below
See #
Describe the scope/purpose of the PR here in as much detail as you like
Categorisation
This PR...
Basic PR Checklist
Instructions for developers:
Instructions for reviewers:
Code Style
No deprecated methods are used
No magic strings/numbers - all strings are in
constantsormessagesfilesES queries are wrapped in a Query object rather than inlined in the code
Where possible our common library functions have been used (e.g. dates manipulated via
dates)Cleaned up commented out code, etc
Urls are constructed with
url_fornot hard-codedTesting
Unit tests have been added/modified
Functional tests have been added/modified
Code has been run manually in development, and functional tests followed locally
Have CSS/style changes been implemented? If they are of a global scope (e.g. on base HTML elements) have the downstream impacts of the change in other areas of the system been considered?
Documentation
FeatureMap annotations have been added
Documentation updates - if needed - have been identified and prepared for inclusion into main documentation (e.g. added and highlighted/commented as appropriate to this PR)
Core model documentation has been added to if needed: https://docs.google.com/spreadsheets/d/1lun2S9vwGbyfy3WjIjgXBm05D-3wWDZ4bp8xiIYfImM/edit
Events and consumers documentation has been added if needed: https://docs.google.com/spreadsheets/d/1oIeG5vg-blm2MZCE-7YhwulUlSz6TOUeY8jAftdP9JE/edit
The docs for this branch have been generated and pushed to the doc site (see docs/README.md for details)
Release Readiness
If needed, migration has been created and tested locally
Release sheet has been created, and completed as far as is possible https://docs.google.com/spreadsheets/d/1Bqx23J1MwXzjrmAygbqlU3YHxN1Wf7zkkRv14eTVLZQ/edit
There has been a recent merge up from
develop(or other base branch). List the dates of the merges up from develop belowTesting
List the Functional Tests that must be run to confirm this feature
Deployment
What deployment considerations are there? (delete any sections you don't need)
GoalsUrlshortshould be added to plausibleConfiguration changes
What configuration changes are included in this PR, and do we need to set specific values for production
Scripts
What scripts need to be run from the PR (e.g. if this is a report generating feature), and when (once, regularly, etc).
Migrations
What migrations need to be run to deploy this
Monitoring
What additional monitoring is required of the application as a result of this feature
New Infrastructure
What new infrastructure does this PR require (e.g. new services that need to run on the back-end).
Continuous Integration
What CI changes are required for this