-
Notifications
You must be signed in to change notification settings - Fork 10
How to patch an old adaptor version
Very occasionally, we get into a situation where we want to issue a patch release to an old major (or even minor) adaptor version.
For example, a critical bug comes out for salesforce v3.x and we need to update its jsforce, but main
has salesforce v5.x. You can't just patch the main version and set the version back to 3.whatever, it'll be totally the wrong code version and incompatible with workflows on 3.x.
But there is a way. We basically checkout a tag and create a temporary branch which does not get merged to main. We'll release from this branch
This Wiki will show you how to do it.
- Check out the closest tag to the version you want to patch. Something like
git checkout @openfn/language-common@1.15.2
- Checkout a new branch from this tag
- Make your changes
- Create a changeset
- Open a PR and add the
DO NOT MERGE
label - Review as usual
- When you're ready, bump versions
Note: If you're bumping common, you may have to update dependencies of packages within the monorepo. Do not create changesets for these packages unless you absolutely have to.
The goal here is only to have a version bump for the one adaptor that's changed. If you're bumping a legacy common version, you should probably update dependencies on main after releasing the patch version. This stuff gets a bit weird and confusing.
I recommend you release the patched version through CI (github actions). But it is a little hacky.
When you're ready to release, update .github/workflows/publish.yaml
along these lines:
- Publish on push, by changing the
on
line at the top toon: push
. This means that every subsequent push to your temporary release branch will attempt to publish. - Update the actual publish command so that the
legacy
tag is added to the new release instead of latest. Also update the branch name. So therun: pnpm:publish
line becomes something like this:
- run: pnpm publish -r --report-summary --publish-branch <YOUR_BRANCH_NAME>
--access=public --tag legacy --no-git-checks
Commit the changes to publish.yaml and push. This should instantly trigger a build and publish.
If releasing through CI is too much of a hassle, you may want to just do a local release with pnpm publish
.
You still need a command like:
pnpm publish -r --publish-branch <BRANCH-NAME> --access=public --tag legacy --no-git-checks
You will need a OTP from npmjs to do this, or the right permissions on your account.
If you do this, you need to make ABSOLUTELY SURE that your local repo is properly built.
You should probably use --dry-run
first to test changes before actually releasing.
You may have to push tags for the new versions manually.
Close the PR.
Do not delete the branch.
Some old patch branches for reference: