-
Notifications
You must be signed in to change notification settings - Fork 141
CBG-4753: Add version_type preference for /_changes to allow CV-aware consumers
#7659
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
d93054a
Add version_type option for REST API changes feeds to allow consumers…
bbrks 6535ba7
Support sending changes for old rev-only docs on a cv changes feed
bbrks f2b25f8
Use typed consts for expectedVersionType in subtest fields
bbrks f6a1681
Update OpenAPI spec
bbrks c1d85c1
Pass through version type from RequireChangeRev helper
bbrks 64202a8
Specify or `cv` in OpenAPI spec description
bbrks 5aefeac
Godoc correction for revOrCV
bbrks 9b48322
Lookup ChangeEntry version instead of using preference to produce aud…
bbrks 49cb009
Add TODOs - some rev-ID only code that is queued behind another ticke…
bbrks d9f41b4
missing AuditReadEvent params
bbrks 7f10a9b
Fetch by CV/RevID in include_docs style changes feed
bbrks e4b21b8
Rewrite switch case in `createChangesEntry` to have assert case inste…
bbrks e79e7ca
Continue returning metadata only changes `row` without doc body for e…
bbrks 09c2719
Use consts in switch case for `createChangesEntry` (handle empty stri…
bbrks 7a5e448
%s -> %q for logging version type in changes options
bbrks f2950cc
godoc comment for ParseChangesVersionType
bbrks ca9a072
Assert for length check in ChangeVersionString
bbrks ad063d9
Stamp _cv in changes bodies instead of TODO
bbrks File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some general thoughts that aren't actionable necessarily:
I don't love that this could be revOrCV here. I think a totally more correct way would be to pass a
DocVersionhere that is only used in tests. I experimented a bit with this and I couldn't make it work without refactoring. We don't have adb.VersionforDocVersion.CVin the calling functions here. I didn't have time to consider whether it would be more appropriate to have ChangeEntry.Changes actually have a non string version of the CV.I don't think we have time for this for a release, but it might be worth thinking about in general.
Other places in crud the API is
revTreeID string, cv *db.Versionas indocumentRevisionForRequestand so changing this would involve downstream changes outside of the scope of this PR.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of this is tied to CBG-4776 because there will be a new requirement for passing "one of cv or revid" down from REST APIs in a fetch (which eventually reaches this codepath)
The problem is all of these areas of rev/cv have been added piecemeal with no real design or consistency - which I completely agree is a problem, but one that doesn't need solving right now.
stringis dumb but achieves this "oneOf" requirement easily and with sufficient naming and documentation I don't see it being a problem in reality. If we're accidentally passing in docID or something then we'll find out about that pretty quickly in our tests.