Skip to content
This repository was archived by the owner on Mar 23, 2026. It is now read-only.

Introduce dependency pinning#10127

Merged
silv-io merged 13 commits into
masterfrom
dependency-pinning
Feb 6, 2024
Merged

Introduce dependency pinning#10127
silv-io merged 13 commits into
masterfrom
dependency-pinning

Conversation

@silv-io
Copy link
Copy Markdown
Member

@silv-io silv-io commented Jan 26, 2024

Motivation

We continuously run into issues with the pipeline that are caused by an updated dependency. Dependencies currently can just update on the fly in an uncontrolled manner and we don't know when a dependency receives an upgrade.
This can obscure other issues with the pipeline or otherwise reduce the development velocity.

Changes

This PR and its companion in the Ext repository introduce dependency pinning in LocalStack Ext and Core.

To this end, new make targets are added which allow for the creation of lock files with the naming scheme requirements-<extra>.txt. These make targets can either be executed in CI or locally by devs:

  • In the case of CI, this PR introduces a new workflow upgrade-python-dependencies which periodically (Mondays at 5AM - same as the ASF updates) and in a controlled manner update all the dependencies in the lock file to latest allowable versions defined in setup.cfg

  • In the case of devs, this PR introduces a new pre-commit hook, referenced from the https://github.com/localstack/pre-commit-hooks repository, which checks whether a change in setup.cfg would make the lock files incompatible with the setup.cfg. If that is the case, the hook would fail and the dev will be prompted to run the make target for upgrading all dependency lock files. As an extra precaution, the run of this pre-commit hook was additionally added to the CI pipeline in the linting step.

Testing

To test out how the pinning works you can execute the upgrade-pinned-dependencies make target.
You can add any package you wish to the setup.cfg and stage it and try to commit it to check if the pre-commit hook works.
You can also manually run the pre-commit hook with the staged changes in the setup.cfg:

pre-commit run check-pinned-deps-for-needed-upgrade --files $(git diff --name-only --cached)

TODO

What's left to do:

  • Make sure all CI pipelines are green in the PR
  • Make sure the release process is solid
  • Decide on what to do with the eager updating in the Docker build
  • Run the dependency upgrade before merge to get off to a good start ;)

@silv-io silv-io self-assigned this Jan 26, 2024
@silv-io silv-io added area: dependencies Pull requests that update a dependency file semver: patch Non-breaking changes which can be included in patch releases labels Jan 26, 2024
@silv-io silv-io added this to the 3.2 milestone Jan 26, 2024
@silv-io silv-io changed the title Add facilities for dependency pinning Introduce dependency pinning Feb 1, 2024
@silv-io silv-io force-pushed the dependency-pinning branch from f41fa6a to 7e9d0ef Compare February 1, 2024 13:43
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 1, 2024

S3 Image Test Results (AMD64 / ARM64)

  2 files    2 suites   3m 19s ⏱️
386 tests 336 ✅  50 💤 0 ❌
772 runs  672 ✅ 100 💤 0 ❌

Results for commit 57e2443.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 1, 2024

LocalStack Community integration with Pro

    2 files      2 suites   1h 21m 51s ⏱️
2 622 tests 2 373 ✅ 249 💤 0 ❌
2 624 runs  2 373 ✅ 251 💤 0 ❌

Results for commit 57e2443.

♻️ This comment has been updated with latest results.

@coveralls
Copy link
Copy Markdown

coveralls commented Feb 2, 2024

Coverage Status

coverage: 83.845%. remained the same
when pulling 57e2443 on dependency-pinning
into 87cd8f5 on master.

@silv-io silv-io force-pushed the dependency-pinning branch from 150dab1 to 15c285d Compare February 5, 2024 10:42
@silv-io silv-io marked this pull request as ready for review February 5, 2024 14:18
@silv-io silv-io requested a review from alexrashed as a code owner February 5, 2024 14:18
Copy link
Copy Markdown
Member

@alexrashed alexrashed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR will solve so many issues in our build pipelines! 💯 🦸🏽 😄
It already looks great, I only have a few questions and nitpicks (some confusion about naming and some somwhat unrelated changes).
We also need to make sure that the pipeline cache keys are adjusted accordingly.

Afterwards we should be good to go! 🚀

Comment thread Makefile
Comment thread Makefile Outdated
Comment thread Makefile
Comment thread Makefile Outdated
Comment thread Makefile Outdated
Comment thread setup.cfg
Comment thread pyproject.toml Outdated
@silv-io silv-io force-pushed the dependency-pinning branch from e4f38fd to 2b22f1b Compare February 6, 2024 08:52
@silv-io silv-io force-pushed the dependency-pinning branch from 4428e54 to 8bb9fa8 Compare February 6, 2024 10:46
@silv-io silv-io requested a review from alexrashed February 6, 2024 11:18
Copy link
Copy Markdown
Member

@dfangl dfangl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good from my side! Great work!

Copy link
Copy Markdown
Member

@alexrashed alexrashed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aweseome! Thanks for addressing all the comments, and the great PR in general! And thanks to @dfangl for another pair of eyes! 🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area: dependencies Pull requests that update a dependency file semver: patch Non-breaking changes which can be included in patch releases

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants