Fix constraints and update yarn lock at the end of release process#145
Fix constraints and update yarn lock at the end of release process#145cryptodev-2s merged 19 commits intomainfrom
Conversation
|
The tests are failing! And in the local as well. |
|
@kanthesha yes the functional test are failing. In the current testing configuration I need to add a constraints file, currently working on it. |
kanthesha
left a comment
There was a problem hiding this comment.
Overall LGTM. I have made some minor suggestions.
mcmire
left a comment
There was a problem hiding this comment.
Is there a functional test we can add to confirm that the workflow bug we are trying to solve is fixed?
| packageManager: 'yarn@3.2.1', | ||
| }); | ||
|
|
||
| const constraintsProContent = ` |
There was a problem hiding this comment.
Hmm... this constraints file doesn't really check anything I don't think? I believe that Yarn looks for certain predicates to exist. Perhaps this just file just needs to be present?
There was a problem hiding this comment.
It checks that each package has a name and a version field.
it's required for the constraints fix otherwise it throws This package doesn't seem to be present in your lockfile; run "yarn install" to update the lockfile
There was a problem hiding this comment.
That's a strange error when the constraints file doesn't exist. I would have expected something like "constraints.pro not found".
I just tried removing these lines and running the tests and they don't seem to fail with the error you describe 🤔
There was a problem hiding this comment.
we can remove the constraints file only the plugin installation is required (the error I sent earlier was related to the plugin installation removal), but don't we want to test that constraints check really works as this constraints at least checks that each package has a version and name, we can add more checks ? in this case we can also make this testing in a separate scenario as you proposed later (sorry I just saw the other comment)
|
Also can we update the PR description to describe the problem that we are solving here and how the changes solve that problem instead of just describing the changes? That would help us understand the context behind this PR in the future. |
I updated the description |
| packageManager: 'yarn@3.2.1', | ||
| }); | ||
|
|
||
| const constraintsProContent = ` |
There was a problem hiding this comment.
That's a strange error when the constraints file doesn't exist. I would have expected something like "constraints.pro not found".
I just tried removing these lines and running the tests and they don't seem to fail with the error you describe 🤔
|
Just repeating my comment above about adding a functional test here. I think the problem that running |
mcmire
left a comment
There was a problem hiding this comment.
Sorry for the long delay in reviewing this. Looks good to me.
| ); | ||
| }); | ||
|
|
||
| it('updates the dependency version in package "b" when package "a" version is bumped', async () => { |
There was a problem hiding this comment.
create-release-branch runs yarn constraints --fix and doesn't care what the constraints are exactly. So it isn't necessary the case that create-release-branch always updates dependencies like this — it really depends on what the project's constraints file does (a project may have different constraints, in theory). That said, I'm okay with using this test name since it points to why we decided to add yarn constraints --fix in the first place. If we ever want to run constraints for a different reason we may have to adjust this test name to be more accurate, but I don't anticipate that happening any time soon.
Description
In our current release process, we often encounter issues with dependency constraints, outdated yarn.lock files, and duplicated dependencies. These issues can lead to inconsistencies in our release process. Additionally, these steps are frequently needed whenever we release our packages, making the process cumbersome and error-prone.
Solution
This PR adds a new step to our release tool to streamline and automate the process. This step will:
Implementation Details