-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Improve changelog detection for monorepos #2926
Comments
In they the release notes for manager-package-release should always be the same. But the raw commit "compare" link can be different, namely whether the user is comparing it to the previous stable version or the previous unstable version. Each "release" should have a "gitRef", whether that's a tag (e.g. v1.0.1) or a raw commit hash. Then the exact compare links can be generated per-PR. |
Having just found this issue after trying to get changelogs working for our monorepo packages, I take it there's no workaround at the moment? Using lerna with individual versioning and have one CHANGELOG.md in each package and also tried to update the release tags ( |
Can you replicate it in a public repo or find a public lerna repo that uses the same approach you do, that can be tested against? |
Not sure if this is something thats interesting or not but figured I'd share it here: Suppose this could potentially help with detecting changelog files for monorepo packages? :) |
Thanks, I've seen that one and partially implemented it already. We already do a search for subdirectories containing the package name so that captures nearly all the use cases already anyway. |
Even if a changelog could not be detected, it would be nice if Renovate could add a "Compare source" link that links to comparison page of that subfolder so I can inspect the commits |
@felixfbecker I've never seen a subfolder compare link before. Do you have an example for GitHub? |
Hmm, doesn't seem to exit in the UI. Maybe a link to the history page of the folder then? https://github.com/renovatebot/renovate/commits/master/docs |
OK so if source directory is defined in package.json but no CHANGELOG file is found within that directory, then link to the directory's commit history? |
Does this mean that if I have a monorepo with a package name
It would detect the changelog and present it already? I suppose this doesn't work for scoped packages where I would have eg Is there anything I can set in package.json files to make it detect nested changelogs today? |
Can you describe your situation in full? Eg self hosted or GitHub.com? Directory structure, etc |
Its on github. So using this as an example: packages/renovate-bug-dep contains a package with name For version 1.1.4 of the package there's also a github release tagged as @flydiverny/[email protected] Here's a PR from renovate trying to update this dependency: Flydiverny/renovate-workspace#2 Don't mind the repo and package names :) In our project its similar with the main difference being private github repo and private packages on npm. |
@Flydiverny thanks for the example! That's exactly what I needed. Can I assume that the GitHub Releases entry and CHANGELOG.md entries should always be identical, i.e. we can use whichever one works best for our internal logic? |
@rarkins Yes they are supposed to match :) using lerna to generate both of them here as they recently added a The github release requires the end user to specify github token tho so its a bit more of a hassle to use. But I personally prefer github releases anyway. |
Alright thanks, I think we have enough info to fix it! |
Next steps: debug changelog retrieval using the reproduction repos from @Flydiverny here: #2926 (comment) Either fix/improve our existing release parsing (we should be able to locate the package/release combination) or locate the nested CHANGELOG.md files |
Is there any update on this? We use Should I put CHANGELOG.md that aggregates all changelog for packages in the root directory? The following is the monorepo. The following is a PR to update the package version by Renovate. Thanks! |
@koba04 No, you shouldn't need to change the way your do the individual CHANGELOG files, Renovate should be updated to accommodate/detect that. |
@koba04 actually, you do need to make some changes though. Currently your monorepo is not complying with npm's |
Previosly, when RenovateBot would update this package in other projects, it was unable to read the CHANGELOG.md file. This is because the package lives in a monorepo, so RenovateBot didn't know where to look for the changelog of the specific package being updated. This follows RenovateBot's suggestion, and should fix the issue. See the suggestion here: renovatebot/renovate#2926 (comment)
Previosly, when RenovateBot would update this package in other projects, it was unable to read the CHANGELOG.md file. This is because the package lives in a monorepo, so RenovateBot didn't know where to look for the changelog of the specific package being updated. This follows RenovateBot's suggestion, and should fix the issue. See the suggestion here: renovatebot/renovate#2926 (comment)
# [@bigpopakap/eslint-config-v1.1.15](https://github.com/bigpopakap/shared-node-tools/compare/v1.1.14-@bigpopakap/eslint-config...v1.1.15-@bigpopakap/eslint-config) (2020-01-16) ### Bug Fixes * **package.json:** add directory to package.json within monorepo ([85e9ef9](85e9ef9)), closes [/github.com/renovatebot/renovate/issues/2926#issuecomment-575094237](https://github.com//github.com/renovatebot/renovate/issues/2926/issues/issuecomment-575094237) * **package.json:** add license, keywords and bug tracker link ([9d795b1](9d795b1)) * **readme:** fix erroneous trailing comma in package.json snippet ([4d21a9e](4d21a9e))
# [@bigpopakap/renovate-config-v1.0.4](https://github.com/bigpopakap/shared-node-tools/compare/v1.0.3-@bigpopakap/renovate-config...v1.0.4-@bigpopakap/renovate-config) (2020-01-16) ### Bug Fixes * **package.json:** add directory to package.json within monorepo ([85e9ef9](85e9ef9)), closes [/github.com/renovatebot/renovate/issues/2926#issuecomment-575094237](https://github.com//github.com/renovatebot/renovate/issues/2926/issues/issuecomment-575094237) * **package.json:** add license, keywords and bug tracker link ([9d795b1](9d795b1))
# [@bigpopakap/stylelint-config-v1.0.10](https://github.com/bigpopakap/shared-node-tools/compare/v1.0.9-@bigpopakap/stylelint-config...v1.0.10-@bigpopakap/stylelint-config) (2020-01-16) ### Bug Fixes * **package.json:** add directory to package.json within monorepo ([85e9ef9](85e9ef9)), closes [/github.com/renovatebot/renovate/issues/2926#issuecomment-575094237](https://github.com//github.com/renovatebot/renovate/issues/2926/issues/issuecomment-575094237) * **package.json:** add license, keywords and bug tracker link ([9d795b1](9d795b1))
Always seeing duplicate version entries for traefik |
@rarkins koba04/gatsby-source-kintone#28 Am I missing something? |
@koba04 can create a minimal reproduction to debug against? |
@rarkins I've created a reproduction.
I've expected that the PR includes the changes in the CHANGELOG.md |
Thank you for providing a reproduction. |
Hi @rarkins, I had a go at fixing this but ran out of time. I think the issue are:
but, this approach still fails if the package doesn't specify So perhaps #9061 is a better approach? |
Thank you for providing a reproduction! 🎉 🚀 The Renovate team will take a look at the reproduction repository. Once we confirm the provided repository reproduces the problem, the label will be changed to |
🎉 This issue has been resolved in version 25.47.6 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
The original data model for changelog was to assume a 1:1 mapping between package and source repository.
For monorepos, there are multiple challenges:
changelog.md
files (Support nested changelog.md files #2162)v6.0.0
) and sometimes with name+version, e.g.[email protected]
So our challenge is:
Also related: what to do if a changelog.md file is updated (e.g. improved) in
master
branch well after publication of the package? Most of the time we'd want to update the PRs with that new info, but perhaps not always.Then the challenge is how to de-duplicate it within the PR body. If each package has identical from/to versions and identical content, then we should just display it once. But what if it's a mix of shared and non-shared?
The text was updated successfully, but these errors were encountered: