-
Notifications
You must be signed in to change notification settings - Fork 271
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
Add support for artifact branches #4190
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
b06cc65
to
e571c63
Compare
Why restrict groupId and artifactId to use |
yeah, I wasn't convinced of this myself, just that now would be a good opportunity to do it, in case we do something similar as with version. The length should remain restricted though, based on the database column size. |
Agree on the length restriction, as that always existed but wasn't documented in the openapi. But I don't think restricting the characters for those two fields makes sense unless we can find a reason for it. |
got it, I'll update it. |
Can you explain in this PR, at a high level, how the branches API is designed to work? Or how a user is expected to use branches in the "manual" use-case? I can see how this would work in the case of automatic branches (latest + semantic versioning). Looking at the openapi, it looks like I can do the following:
Is this right? If yes, what's the flow for manual curation of a branch? I assume:
I suppose I could add the same version to multiple branches as well, right? There isn't an explicit Create Branch I don't think? Maybe there should be one? What about automatic branch creation for semantic versioning? Will I be able to delete those branches? Can I change the versions available on them? Can I remove a version from a branch if I added it by mistake? |
app/src/main/resources/io/apicurio/registry/storage/impl/sql/h2.ddl
Outdated
Show resolved
Hide resolved
app/src/main/resources/io/apicurio/registry/storage/impl/sql/h2.ddl
Outdated
Show resolved
Hide resolved
Can I add a version to a branch during version creation? That would be interesting. |
app/src/main/java/io/apicurio/registry/rest/v3/GroupsResourceImpl.java
Outdated
Show resolved
Hide resolved
app/src/main/java/io/apicurio/registry/storage/impl/sql/AbstractSqlRegistryStorage.java
Show resolved
Hide resolved
Do you have new tests for the branch API? This is a big PR but I looked and didn't see anything. |
I think only on the storage level. I'll add one on the REST layer. |
Good idea, will try to implement this. |
…xception The original exception might have a specific HTTP error code, or we might want to avoid triggering health checks for it. Wrapping interferes with this, and is unnecessary for RuntimeExceptions. We should only wrap in specific circumstances.
e571c63
to
d2ebd57
Compare
d2ebd57
to
9f31425
Compare
Resolved: - remove format restrictions on group and artifact ID - more consistent naming - support specifying branches on artifact (version) creation - support branch "rebase" - add tests - small bug fixes
9f31425
to
499213e
Compare
So, I've added the following changes based on the review:
Branches represent a sequence of versions. Currently, the main use-case is that they can be referenced in endpoints where a version name is expected. Instead of specifying a version directly, users can provide a version expression, e.g.
Semantic versioning is the main use-case at the moment. The GroupsResourceTest provides a good showcase for available operations. Most common, I assume, will be the new feature, where users can specify the branch when creating a new version.
Correct!
I went with the create or update-style design, where a branch is created automatically as soon the first version is added to it. I think it fits the lightweight nature of branches, since they currently don't have a dedicated table for metadata. This can change in the future of course, e.g. if we need to track branch author, properties etc.
yes, the plan is that they will work as any other branch, the only difference is that versions will be added to them automatically, based on content or provided metadata.
yes, using the "rebase" (create or replace) operation. |
Notes and highlights:
versionExpression
to differentiate between cases where user has to specify plain version directly. This replaces the special keywordlatest
that we have currently. Users can use thelatest
branch, that is always available, by specifying.../branch=latest/...
.