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: Don't attempt publishing non-latest published versions #91

Merged
merged 4 commits into from
Sep 28, 2023

Conversation

Gudahtt
Copy link
Member

@Gudahtt Gudahtt commented Sep 28, 2023

When deciding whether to attempt publishing a package, this action would previously compare the latest published version with the current version. If they don't match, it would try to publish the package. However, that version may have been published already, just not as the latest version.

This is especially problematic for backports within monorepos. This would result in errors if any package was already published but not at the latest version.

The script has been updated to check whether the given package version was published at all. It no longer matters whether it was latest or not.

This also fixes the "update-packages-test", which tests with an old version of the snaps monorepo. It was broken because all of the packages being tested have had releases since the last successful run. The test has been updated to add debug logs, and the expected number of packages published has been changed to "2".

The test bumps 3 packages and decrements one. One of the bumped packages was the examples package, which is private, so that has always been ignored. The expected number of packages has changed from 3 to 2 because the decremented package is now skipped (it was already published).

@Gudahtt Gudahtt force-pushed the prevent-invalid-publishing-attempts branch 2 times, most recently from a7916b5 to 704410b Compare September 28, 2023 13:51
When deciding whether to attempt publishing a package, this action
would previously compare the latest published version with the current
version. If they don't match, it would try to publish the package.
However, that version may have been published already, just not as the
latest version.

This is especially problematic for backports within monorepos. This
would result in errors if any package was already published but not at
the latest version.

The script has been updated to check whether the given package version
was published at all. It no longer matters whether it was latest or not.

This also fixes the "update-packages-test", which tests with an old
version of the snaps monorepo. It was broken because all of the
packages being tested have had releases since the last successful run.
The test has been updated to add debug logs, and the expected number of
packages published has been changed to "2".

The test bumps 3 packages and decrements one. One of the bumped
packages was the `examples` package, which is private, so that has
always been ignored. The expected number of packages has changed from 3
to 2 because the decremented package is now skipped (it was already
published).
@Gudahtt Gudahtt force-pushed the prevent-invalid-publishing-attempts branch from 704410b to 5d3b52b Compare September 28, 2023 13:51
@Gudahtt Gudahtt marked this pull request as ready for review September 28, 2023 13:52
@Gudahtt Gudahtt requested a review from a team as a code owner September 28, 2023 13:52
.github/workflows/build-lint-test.yml Show resolved Hide resolved
.github/workflows/build-lint-test.yml Show resolved Hide resolved
action.yml Outdated Show resolved Hide resolved
@Gudahtt Gudahtt requested a review from Mrtenz September 28, 2023 14:12
action.yml Outdated Show resolved Hide resolved
@Gudahtt Gudahtt merged commit 9f9f3f9 into main Sep 28, 2023
@Gudahtt Gudahtt deleted the prevent-invalid-publishing-attempts branch September 28, 2023 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants