exec plugin with successCmd can causes *first release only* of maintenance branch to fail #3523
-
|
Hello I have a problem when using module.exports = {
branches: [
'+([0-9])?(.{+([0-9]),x}).x',
'release',
],
plugins: [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@terrestris/maven-semantic-release",
{
"settingsPath": process.env.MAVEN_SETTINGS,
"clean": false,
"updateSnapshotVersion": "true",
"processAllModules": "true"
}
],
[
"@semantic-release/git",
{
assets: ["**/pom.xml"]
},
],
"@semantic-release/gitlab",
["@semantic-release/exec", {
"publishCmd": "echo VERSION_BUILD=${nextRelease.version} > version.env",
"successCmd": "cat version.env && touch RELEASE_DONE"
}]
],
};which gives this execution log : in this execution log, you can see that there are two lines and there is no commit analyzer ran at all. Complete log is here execution.log Can some tell me what's wrong in my settings there please ? |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 21 replies
-
|
@travi I'm really sorry to pinging you so rudely, but can you have a look at my question which really blocks me please 🙏 |
Beta Was this translation helpful? Give feedback.
-
|
based on a quick look, i dont see anything obvious. order of defining the plugins is important in your config, but it looks like that is correct already. this suggests that it should be ready to be used:
if you arent already, you could try to use the debug flag when you execute. you may need to create a minimal reproduction in a public project for us to dig further from this side. |
Beta Was this translation helpful? Give feedback.
-
when you are releasing a maintenance version, does a release for the range defined for the branch already exist or are you creating the maintenance branch with the expectation that the first release for that range will be created? i havent had the time to completely confirm my suspicion, but it looks like you are approaching this workflow expecting the latter |
Beta Was this translation helpful? Give feedback.
-
|
Hi ! Could it come from the fact that for this bloc of semantic-release execution, only Lines 110 to 153 in 6022328 However, at first glance, I don't see why it would work the second time ... What makes me say it could come from here (may be an expected behavior) is that on @djeanprost first CI error, this line appears Found 4 commits since last release and then it goes straight to From the look of it, the only execution succession giving this is there. And it does seem that this execution flow is specific to maintenance branches ? Lines 117 to 121 in 6022328 |
Beta Was this translation helpful? Give feedback.
-
|
in attempting to look into this issue, i've been looking through historical discussions to see if others have come across any similar behaviors. while doing so, i spotted a previous thread that you started where you mentioned behavior that wasnt working correctly with the first execution, but was working with a second run. i see that i didnt manage to respond to that one, so apologies for that. did you end up solving that situation? it is interesting that you've seen misbehavior on first run but correct behavior on a second run in both cases. this makes me further wonder if there is something about your workflow that i havent grasped yet that might be presenting this situation. you havent described anything yet that gives me any real confidence that this is the case, but this is at least an interesting pattern that stands out to me |
Beta Was this translation helpful? Give feedback.
-
|
Hey @djeanprost, After looking at this and the threads in this discussion, I think there's an imperative part of the error that you might be unintentionally leaving it out.... See below.. It point out how the BUT the WEIRD BUT is that the Why? How come the |
Beta Was this translation helpful? Give feedback.
-
|
Hello @travi, After further investigation, it's really coming from here: https://github.com/semantic-release/semantic-release/blob/master/index.js#L151 What is happening:
Why does it fail on @djeanprost specific case ?Simple, Multiple questions come to mind with this specific discussionHistorically, from oldest to newest (yes I checked previous commits impacting this code), it seems tags were created, which was a justified reason to call Which poses with, do we still need to run 7b40524#diff-e727e4bdf3657fd1d798edcd6b099d6e092f8573cba266154583a746bba0f346R112-R123 aec96c7#diff-e727e4bdf3657fd1d798edcd6b099d6e092f8573cba266154583a746bba0f346R109-R122 b2c1b2c#diff-e727e4bdf3657fd1d798edcd6b099d6e092f8573cba266154583a746bba0f346L112-R115 Another question that comes to my mind, and I can backup it with this pull request and gitlab run (thanks @djeanprost):
It seems on top of that, that this |
Beta Was this translation helpful? Give feedback.
Hello @travi,
After further investigation, it's really coming from here:
https://github.com/semantic-release/semantic-release/blob/master/index.js#L151
What is happening:
1.3.01.4.0,1.5.0, etc.1.3.0for any justified reason (security, etc.)1.3.xand push (directly or with a pull request it doesn't matter) the appropriate fix on it1.3.1