-
Notifications
You must be signed in to change notification settings - Fork 30
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 task for closing a staging repository #4
Comments
Note: "staging repository id" should be visible to the end-user anyway. Use case: generate draft mail on "Nexus repository preview" |
Yes, we plan to expose it as an extension property as currently in GNSP. |
Can it be a task property rather than an extension property? |
As I will be set by one task ( |
The value is not usable before the task is executed, so it looks pretty natural to add |
Not always. You may want to close/release a staging repository created with some older Gradle execution (on demand or dealing with some errors). |
Do you mean the property would be "read only"? If that is the case, it might be ok. However, having a single property would indeed impact the ability to have multiple repositories. Then, Gradle "forbids" cross-project access. In other words, the order of project evaluation is not really consistent, so it might be the case that subproject is evaluated before the root project, thus the extension might be not there (or be empty). AFAIK "it is a code smell every time cross-project APIs are invoked". |
I think it should be a property of |
If possible, we should probably only expose a |
By keeping a reference to NexusRepository.
I gave it a bit of though, and now I think the "minimal" implementation should allow to store the "necessary information" at the Nexus (server) side (e.g. in staging repository comment or something like that). In other words, I would like to have a task (or API) like It would enable end-users to clean the workspace and still associate staging repository with the intended release step. Here's a similar case: vlsi/vlsi-release-plugins#26 Apache releases are typically "staged" to SVN folders like https://dist.apache.org/repos/dist/dev/jmeter/apache-jmeter-5.2.1-rc1/ , and for release the contents is moved to folders under https://dist.apache.org/repos/dist/release/jmeter/ There we have the same question: "we need to track the set of the file names to be released". My initial (current) implementation was to use build artifacts to get the set of release files, and that turned out to be bad, because "publish release" task starts depending on the full build procedure, and it becomes fragile (you don't want to pray in a hope that all the tasks would be UP-TO-DATE). As of now, I'm inclined that external service should be treated as a primary store. That is developer should be able to "stage the artifacts", perform "./gradlew clean", and then they should be able to release the repository. I propose the following workflow: Stage release artifacts
Verify release
Publish releaseThe release manager remembers "release candidate version" to be released, and it passes that parameter to the build script. ^^^ Note: the above is not something that must be used by everybody. It is just a sample. In other words, I suggest using Nexus Server for storage of "repository id" rather than "repository extension". @marcphilipp , @szpak , what do you think? |
Would it suffice if the close task would check for open staging repos and fail if there's more than one, but print as much info (URL, comment) of each as possible? Users could then re-run the goal and pass the one they meant explicitly. |
Hmmm 🤔If I use one credential for Sonatype I can't release some modules parallel? Moreover, we have a case with release one module for different Scala targets (2.11, 2.12, 2.13) from parallel Travis jobs, that open many staging repos at the same time. |
Sure, you can. My proposal was only when the close task was executed by itself with a clean workspace and no parameters. If you close from the build that published, we would know which staging repo to close. |
mustRunAfter
dependencies to all publish tasks (across projects) to support parallel multi-project buildsThe text was updated successfully, but these errors were encountered: