Skip to content
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

fix: do not fail on closure of already closed Nexus repositories #477

Merged
merged 3 commits into from
Feb 5, 2023

Conversation

nicolasfara
Copy link
Contributor

When using the plugin in a "multi-stage" deployment, on the final job (using semantic-release) the releaseStagingRepositoryOnMavenCentral task is called. This task depends on the closeStagingrepositoryOnMavenCentral, but since the staging repo is closed on the previous CI job (the job that tries to upload and close the staging repo), the staging repo will be closed twice producing the following errors:

:closeStagingRepositoryOnMavenCentral FAILED
Failed to close staging repository, server at https://s01.oss.sonatype.org/service/local/ responded with status code 500, body: {"errors":[{"id":"*","msg":"Unhandled: Repository: itnicolasfarabegoli-1207 has invalid state: closed"}]}

This PR introduces a check in the closeStagingrepositoryOnMavenCentral that if the repository is already closed, skip the closing action, raising a warning saying that the closing task is skipped

Let me know how does it sound :)

@codecov
Copy link

codecov bot commented Feb 5, 2023

Codecov Report

Base: 0.00% // Head: 0.00% // No change to project coverage 👍

Coverage data is based on head (30ca60b) compared to base (d1fe58f).
Patch coverage: 0.00% of modified lines in pull request are covered.

Additional details and impacted files
@@          Coverage Diff           @@
##           master    #477   +/-   ##
======================================
  Coverage    0.00%   0.00%           
======================================
  Files          11      11           
  Lines         380     387    +7     
  Branches       31      32    +1     
======================================
- Misses        380     387    +7     
Impacted Files Coverage Δ
...danilopianini/gradle/mavencentral/Configuration.kt 0.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@DanySK
Copy link
Owner

DanySK commented Feb 5, 2023

I made a stylistic check. Verify if it keeps working

@nicolasfara
Copy link
Contributor Author

nicolasfara commented Feb 5, 2023

I made a stylistic check. Verify if it keeps working

I made a minor fix, and now should work

@DanySK DanySK changed the title fix: prevent the closing of a staging repository already closed fix: do not fail on closure of already closed Nexus repositories Feb 5, 2023
@DanySK DanySK enabled auto-merge (squash) February 5, 2023 11:50
@DanySK DanySK merged commit 8c1311c into DanySK:master Feb 5, 2023
DanySK pushed a commit that referenced this pull request Feb 5, 2023
## [3.2.1](3.2.0...3.2.1) (2023-02-05)

### Bug Fixes

* prevent the closing of a staging repository already closed ([#477](#477)) ([8c1311c](8c1311c))

### Build and continuous integration

* change regex to be bash-compliant ([#474](#474)) ([5454a6f](5454a6f))
* fail more clearly ([1e4b851](1e4b851))
* fix pure bash regex matchers ([d1fe58f](d1fe58f))
* improve failure reporting ([1c4822d](1c4822d))
* never release unless all tests pass ([c47a755](c47a755))
@github-actions
Copy link

github-actions bot commented Feb 5, 2023

🎉 This PR is included in version 3.2.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants