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

Plugin ends up abruptly without completition or error, making other plugins not to start #459

Open
thedusansky opened this issue Jun 6, 2023 · 12 comments · May be fixed by #479
Open

Plugin ends up abruptly without completition or error, making other plugins not to start #459

thedusansky opened this issue Jun 6, 2023 · 12 comments · May be fixed by #479

Comments

@thedusansky
Copy link

thedusansky commented Jun 6, 2023

Hi team,

I'm using semantic versioning on a few of our projects. I want to include it in existing projects that already have many releases. Since it's the initial run of sv on the project, it found a lot of commits to include in the initial release.

For some reason, the steps of this plugin finish abruptly, hence other sv plugins can't start (eg @semantic-release/changelog & @semantic-release/gitlab) for creation and publish of the tag.
I've set the debug mode, but can't get much info.
Here is the snippet of the CI job output (I've renamed sensitive info):

[8:04:05 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The release type for the commit is major
[8:04:05 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analysis of 598 commits complete: major release
[8:04:05 AM] [semantic-release] › ✔  Completed step "analyzeCommits" of plugin "@semantic-release/commit-analyzer"
2023-06-06T08:27:23.976Z semantic-release:commit-analyzer Release type 'major' is the highest possible. Stop analysis.

[8:27:23 AM] [semantic-release] › ℹ  There is no previous release, the next release version is 1.0.0-rc.1
[8:27:23 AM] [semantic-release] › ℹ  Start step "generateNotes" of plugin "@semantic-release/release-notes-generator"
2023-06-06T08:27:24.220Z semantic-release:release-notes-generator version: '1.0.0-rc.1'
2023-06-06T08:27:24.220Z semantic-release:release-notes-generator host: undefined
2023-06-06T08:27:24.220Z semantic-release:release-notes-generator owner: 'project'
2023-06-06T08:27:24.220Z semantic-release:release-notes-generator repository: 'project'
2023-06-06T08:27:24.221Z semantic-release:release-notes-generator previousTag: undefined
2023-06-06T08:27:24.221Z semantic-release:release-notes-generator currentTag: 'v1.0.0-rc.1'
2023-06-06T08:27:24.221Z semantic-release:release-notes-generator host: 'https://gitab.server'/
2023-06-06T08:27:24.221Z semantic-release:release-notes-generator linkReferences: undefined
2023-06-06T08:27:24.221Z semantic-release:release-notes-generator issue: 'issues'
2023-06-06T08:27:24.221Z semantic-release:release-notes-generator commit: 'commit'

.releaserc config:

plugins:
  - "@semantic-release/commit-analyzer"
  - "@semantic-release/gitlab"
  - "@semantic-release/release-notes-generator"
  - - "@semantic-release/changelog"
    - changelogFile: CHANGELOG.md
branches:
  - "master"
  - "+([0-9])?(.{+([0-9]),x}).x"
  - name: "rc"
    prerelease: true

CI job definition:

9:semantic versioning (rc):
  stage: Semantic Versioning (rc)
  image: node:18.14.0
  allow_failure: false
  script:
    - touch CHANGELOG.md
    - npm install [email protected] @semantic-release/gitlab @semantic-release/changelog
    - npx semantic-release --debug
  artifacts:
    paths:
      - CHANGELOG.md
    expire_in: 4 week
  rules:
    - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_REF_NAME == "rc"'

Many thanks!

Dusan

@gavmck
Copy link

gavmck commented Jun 6, 2023

Not sure if it's the same issue, but I was seeing this due to not having the changelog preset package installed as well.

Notes: in order to use a preset it must be installed (for example to use the eslint preset you must install it with npm install conventional-changelog-eslint -D)

Edit: actually just rolled back to 19.0.5 of semantic-release and now it works 🤷

@mamachanko
Copy link

We are seeing this as well. Downgrading to [email protected] does the job for us.

The fact that it exits w/o error makes this particularly tricky to spot.

@thedusansky
Copy link
Author

Hi,

I think I've found the root cause.
Since we started to use Semantic Versioning on older projects, on the initial run SV is analyzing ALL commits from the beginning of development. Analyze commit plugin finishes the job correctly and then release-notes-generator starts. My guess is that it finds some "strangely" formatted commit message that cannot be put into the release notes.
My workaround was to run SV with flag --generate-notes false
- npm install [email protected] @semantic-release/gitlab @semantic-release/changelog
- npx semantic-release --generate-notes false

So it will create let's say 1.0.0 tag without release notes on it (actually it's good for us since we don't need the whole project history on the rn). Then I remove this flag and on every other SV run, since it's now analyzing correctly syntexed commits. it generated the release notes and tags as it should.

@acebo
Copy link

acebo commented Jun 8, 2023

I've just faced a similar issue that it does not continue running the next step and no any error message. Workaround by downgrading the version works well for me.

Thank you, everyone 🙏🏻 🙏🏻

Screenshot 2566-06-08 at 15 01 31

efredriksson-modelon added a commit to modelon-community/impact-client-python that referenced this issue Jun 8, 2023
We seems to have run into semantic-release/release-notes-generator#459 trying to do the 3.0.0 release that contains 200+ commits
abhilash-kumar-nair pushed a commit to modelon-community/impact-client-python that referenced this issue Jun 8, 2023
We seems to have run into semantic-release/release-notes-generator#459 trying to do the 3.0.0 release that contains 200+ commits
@andrew-welker
Copy link

I think this might be related to this issue from the get-stream repo. From some local testing, not returning getStream and using something like:

const stream = intoStream.object(parsedCommits).pipe(writer(changelogContext, writerOpts));

const changeLogContent = await stream.toArray();

return changeLogContent.join('');

seemed to solve the issue. This is a suggested method from the get-stream readme as well.

@sathieu
Copy link

sathieu commented Jun 17, 2023

@andrew-welker Can you propose a PR 🙏 ?

@travi
Copy link
Member

travi commented Jun 30, 2023

as explained in #479 (comment), this appears to have been related to a bug in node that has since been fixed. are folks still seeing this on updated node versions?

@marcusrbrown
Copy link

Yes, I experienced the same issue two nights ago when running semantic-release from a GitHub workflow with Node v18.16.0 installed. I hadn't made any releases on that repo, and temporarily pinning semantic-release to 21.0.1 resolved it.

Here's the run showing the issue (before I pinned it):
https://github.com/bfra-me/renovate-config/actions/runs/5409671209/jobs/9830088909

@jhlmco
Copy link

jhlmco commented Jul 2, 2023

I'm also seeing this as well using:

# node -v
v20.3.0

Dropping semantic-release back to 21.0.1 also corrected the error for us.

@zorlem
Copy link

zorlem commented Aug 8, 2023

release-notes-generator from semantic-release 21.0.2 with node 18.16.0 still exhibits the same problem with default configuration for the plugin. It seems that the problem appears when there are more than a certain number of changes that need to be processed for a release, thus resulting in a large amount of notes. This is apparent especially when trying to cut an initial release (1.0.0) from a older repository with a lot of commits.
I solved the issue by manually creating a git tag matching our tagFormat (1.0.0) and pointing to a random commit from some time ago. In our case this resulted in 10x less commits to be considered (450 changes before tagging vs 45 after).

@bradennapier
Copy link

bradennapier commented May 7, 2024

Also running into this issue - it definitely appears to be in consolidating multiple commits and trying to generate a significant release notes.

The problem is fairly difficult and we end up just commenting out release note generator , doing a release without any release notes which is less than ideal.

[4:11:53 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
[4:11:53 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: feat: adds dedicated rest response type for liquidity pool reserves
[4:11:53 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The release type for the commit is minor
[4:11:53 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: feat: adds a dedicated type for liquidity pool information
[4:11:53 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The release type for the commit is minor
[4:11:53 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: feat: adds silverton hybrid orderbook support

BREAKING CHANGE: Pool information is now included in orderbook types and websocket messaging
[4:11:53 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The release type for the commit is major
[4:11:53 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analysis of 973 commits complete: major release
[4:11:53 AM] [semantic-release] › ✔  Completed step "analyzeCommits" of plugin "@semantic-release/commit-analyzer"
[4:11:53 AM] [semantic-release] › ℹ  The next release version is 4.0.0-alpha.2
[4:11:53 AM] [semantic-release] › ℹ  Start step "generateNotes" of plugin "@semantic-release/release-notes-generator"

You can see it just stops after the generate notes step without any error in this case and succeeds but no release is generated.

https://github.com/idexio/idex-sdk-js/actions/runs/8963899307/job/24614859968

In the action you can see it tried to generate notes from our first version (not sure why here but either way, it should not have broken this way and at least given some kind of error).

I believe it to be an issue when trying to merge all the different notes together personally but I haven't tried to dig deeper so far.

It def is odd it analyzed hundreds of commits here as well as its branched off our alpha.1 release.

@travi
Copy link
Member

travi commented May 7, 2024

Could your recent problem be related to the recent breaking changes in conventional-changelog packages? Please be sure you are pinning the major version of packages you are installing along with semantic-release to avoid upgrading before semantic-release ready for the breakages

See #633 for more details

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 a pull request may close this issue.