Skip to content

Conversation

@gr2m
Copy link
Member

@gr2m gr2m commented Feb 3, 2020

fixes #1442

@gr2m gr2m requested a review from pvdlg February 3, 2020 17:43
$ git push origin :refs/tags/<tag name>
```

## release not found in prereleases branch (e.g. `beta`) after rebase on `master`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not specifically related to prereleases branches. This principle is true for any branch.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

semantic-release is using git notes for master, too?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When a new tag is created yes. But if there is a tag without a note then we consider the version was published on the channel associated with master.
So if your version has been published on the channel associated with master (by default not specified so each plugin would use it's specific default such as latest for npm) and next then you will have a note with {"channels:[null,"next"]"}.


1. Delete the tag(s) for the release(s) that have been lost from the git history. You can delete each tag from remote using `git push origin :[TAG NAME]`, e.g. `git push origin :v2.0.0-beta.1`. You can delete tags locally using `git tag -d [TAG NAME]`, e.g. `git tag -d v2.0.0-beta.1`.
2. Re-create the tags locally: `git tag [TAG NAME] [COMMIT HASH]`, where `[COMMIT HASH]` is the new commit that created the release for the lost tag. E.g. `git tag v2.0.0-beta.1 abcdef0`
3. Re-create the git notes for each release tag, e.g. `git notes --ref semantic-release add -f -m '{"channels":["beta"]}' v3.0.0-beta.1`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we should specify that the channel prop should contain the list of channel on which that version was added. If it's the default channel (the first release channel, usually master) then it should be set as null.


1. Delete the tag(s) for the release(s) that have been lost from the git history. You can delete each tag from remote using `git push origin :[TAG NAME]`, e.g. `git push origin :v2.0.0-beta.1`. You can delete tags locally using `git tag -d [TAG NAME]`, e.g. `git tag -d v2.0.0-beta.1`.
2. Re-create the tags locally: `git tag [TAG NAME] [COMMIT HASH]`, where `[COMMIT HASH]` is the new commit that created the release for the lost tag. E.g. `git tag v2.0.0-beta.1 abcdef0`
3. Re-create the git notes for each release tag, e.g. `git notes --ref semantic-release add -f -m '{"channels":["beta"]}' v3.0.0-beta.1`. Add all channels where the version was added. If it's only the default channel (usually `master`), then set it to an empty array: `'{"channels":[]}'`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's only the default channel (usually master), then set it to an empty array: '{"channels":[]}'

That's incorrect. And empty array would creates issues. It should be:

If this version was published only in the default channel (the first release branch, usually master), then the Git note is unecessary.
If this version was published both on the default channel and another one, then a Git note is necessary. The channels property must contains all the channel on which the version was published and null as to be used to represent the default channel, e.g. {"channels":[null,"beta"]}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I misunderstood your previous feedback, sorry, will fix

@gr2m gr2m marked this pull request as ready for review February 8, 2020 00:28
@gr2m gr2m merged commit 804fc2a into master Feb 8, 2020
@gr2m gr2m deleted the gr2m-patch-1 branch February 8, 2020 19:03
@semantic-release-bot
Copy link
Collaborator

🎉 This PR is included in version 17.0.3 🎉

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.

semantic-release does not find latest tag on beta branch

4 participants