-
Notifications
You must be signed in to change notification settings - Fork 587
HDDS-10668. Remove custom dependabot workflow #6501
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
Conversation
|
In the time since #5538 I've had to learn how pnpm works more or less for the new Ozone website, so I'm pretty sure I can explain what happened here. This is still not an area I have much experience in so please double check for yourself. Prior to #5538, we would see dependabot PRs failing in the build step with this error: In the version of the code where we would see this error, we did not explicitly define a pnpm version in package.json. Our pnpm version was still pinned for stability, but it is pinned in pom.xml since #2115 because we have a somewhat atypical build where Maven, our primary build system, then invokes pnpm as a secondary build sytem. Dependabot supports both pnpm v7 and v8. If the project does explicitly define a version in package.json, it will default to v8, the latest. Our atypical build structure did not pin the pnpm version in the typical place in package.json, so dependabot generated the lockfile with pnpm v8. Then our build job would come in after and run on this lockfile with pnpm v7 pinned in pom.xml. The error we were seeing is due to a difference in pnpm v7 and v8. In v8, However, in v7, The solution is just to pin pnpm to a v7 version in package.json where dependabot will see it. This way dependabot generates the lockfile with the same version we will use to build it in the job. So #5538 contained the fix, but it was not the extra dependabot workflow, it was this single line. I was kind of on to this with this comment, but at the time I didn't have enough pnpm knowledge to make the case that the extra workflow was unnecessary, other than that it seemed lots of other people were using pnpm and dependabot without needing it so there must be a simpler fix. For posterity I will answer my own questions now:
I explained the error above, and yes there is a one line config to fix this problem.
Yes both of those threads mention pinning your pnpm version so that dependabot uses the same version as the repo's build, which will fix the problem. All of that to say that code wise this change LGTM since we are now pinning the pnpm version in package.json and the dependabot workflow isn't the actual fix. Based on the PR description I think the reason this PR works is different than we initially thought. There is also the caveat that we have pnpm version pinned in package.json and pom.xml and have to manually keep them in sync. |
|
Thanks @errose28 for the review and explanation about pnpm. |
|
Thanks for the fix and keeping an eye on the dependabot issues @adoroszlai. It's easy for these kinds of things to get neglected. |
(cherry picked from commit 0c59c18)
(cherry picked from commit 0c59c18) (cherry picked from commit fc401bca5cb4bfbf5f5515f2b804dcb74328aae7)
What changes were proposed in this pull request?
HDDS-9171 added a custom workflow for tweaking dependabot's PRs created for frontend dependencies. The goal was to fix the problem:
This problem no longer seems to exist, dependabot updates both
pnpm-lock.yamlandpackage.json. Example: commit and CI run.On the other hand, the additional commit created by the custom workflow (example) has two problems:
Therefore I propose to remove the custom workflow.
https://issues.apache.org/jira/browse/HDDS-10668
How was this patch tested?
N/A