Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1930)

Issue 19990043: Allow revisionless cs: urls to be valid and found.

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 6 months ago by rharding
Modified:
10 years, 6 months ago
Reviewers:
bac, mp+193336, benji
Visibility:
Public.

Description

Allow revisionless cs: urls to be valid and found. - Normally a full qualified store_url has a version on the end. Some users (Jorge) remove those to create bundles that stay up to date with charms vs locked. - This supports that by performing a mongo regex vs exact match query when no revision is found on the charm store urls. https://code.launchpad.net/~rharding/charmworld/fix-revisionless-store_url/+merge/193336 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+24 lines, -1 line) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M charmworld/models.py View 1 chunk +10 lines, -1 line 3 comments Download
M charmworld/tests/test_models.py View 1 chunk +12 lines, -0 lines 0 comments Download

Messages

Total messages: 3
rharding
Please take a look.
10 years, 6 months ago (2013-10-30 21:05:13 UTC) #1
bac
LGTM https://codereview.appspot.com/19990043/diff/1/charmworld/models.py File charmworld/models.py (right): https://codereview.appspot.com/19990043/diff/1/charmworld/models.py#newcode1637 charmworld/models.py:1637: "$regex": charm_description.store_url Perhaps a comment here explaining why ...
10 years, 6 months ago (2013-10-30 21:12:15 UTC) #2
benji
10 years, 6 months ago (2013-10-30 21:12:59 UTC) #3
LGTM once the comments have been considered.

https://codereview.appspot.com/19990043/diff/1/charmworld/models.py
File charmworld/models.py (right):

https://codereview.appspot.com/19990043/diff/1/charmworld/models.py#newcode1630
charmworld/models.py:1630: # That cs url may or may not have a revision in it.
If not, use a
It took me a second to figure out what "cs" was.  That suggests expanding it to
"charmstore" would help a less-involved reader.

https://codereview.appspot.com/19990043/diff/1/charmworld/models.py#newcode1637
charmworld/models.py:1637: "$regex": charm_description.store_url
Do we know that the regex query will return the latest version?

Is there something like a $prefix operator that we could use instead.  If not,
we should meditate upon whether or not a store URL could be interpreted as a
regex.  For example, if a dot were allowed in the name it would match any
character, potentially returning the wrong data.

Once that meditation has been done (or if it has already been done), a comment
noting the potential complications and that they have been considered would be
good.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b