Skip to content

add dependency-update workflow template (fixes #683)#756

Draft
Rimsha2535 wants to merge 1 commit intomainfrom
feature/dependency-update-workflow
Draft

add dependency-update workflow template (fixes #683)#756
Rimsha2535 wants to merge 1 commit intomainfrom
feature/dependency-update-workflow

Conversation

@Rimsha2535
Copy link
Copy Markdown

@Rimsha2535 Rimsha2535 commented Mar 19, 2026

Fixes #683

Checklist

Note: If any of the items in the checklist are not relevant to your PR, just check the box.

For any Pull Request

Is the following correct:

  • the title of the Pull Request?
  • the title of the corresponding issue?
  • there are no other open [Pull Requests](../../../../pulls) for the same update/change?
  • that the issue which this Pull Request fixes ("Fixes...") is mentioned?

When Changes Were Made

Did you:

  • update the changelog?
  • update the cookiecutter-template?
  • update the implementation?
  • check coverage and add tests: unit tests and, if relevant, integration tests?
  • update the User Guide & other documentation?
  • resolve any failing CI criteria (incl. Sonar quality gate)?

When Preparing a Release

Have you:

  • thought about version number (major, minor, patch)?
  • checked Exasol packages for updates and resolved open vulnerabilities, if easily possible?

Notes

  • Changelog was not updated because this is an internal workflow/template change.
  • No separate cookiecutter-template update was needed because the workflow template itself was updated.
  • CI checks are currently failing and will be fixed.

@Rimsha2535 Rimsha2535 requested a review from kratz00 March 19, 2026 14:30
@kratz00 kratz00 changed the title add dependency-update workflow template add dependency-update workflow template (fixes #683) Mar 19, 2026
@Rimsha2535 Rimsha2535 requested a review from ArBridgeman March 30, 2026 12:41
@@ -0,0 +1,60 @@
name: Dependency Update
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You don't need to change it this time, but by convention, we normally name the branch feature/683-dependency-update-workflow.

By having the issue number in the branch name, we can better ensure that the branch name is unique. This can be helpful for locally checking out the branch as it makes it easily more identifiable.

schedule:
# Every Monday at 03:00 UTC
- cron: "0 3 * * 1"
workflow_dispatch:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

workflow_dispatch usually only works if we've merged the branch to the default branch. Ideally, we'd like to test it out before then.

Was there an approach you and @kratz00 had discussed?


One idea is that we could use workflow_call and have .github/workflows/dependency-update.yml called by the ci.yml.


- name: Audit Dependencies
id: audit-dependencies
run: poetry run -- nox -s dependency:audit
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We can ask the users of the python-toolbox what they'd prefer.

When I'd written that we perform a check by running poetry run -- nox -s dependency:audit, I had thought we could check to see if there are vulnerabilities detected or not. If there were vulnerabilities, then we'd proceed with updating the dependencies. Otherwise, we would skip the update.

One way to do this would be to check the length of the produced JSON;

# this will both print the results & output them to a json file
poetry run -- nox -s dependency:audit | tee vulnerabilities.json

LENGTH=$(jq 'length' vulnerabilities.json)
echo "count=$LENGTH" >> $GITHUB_OUTPUT

In the next step, where we run update-dependencies, we can add an if-statement

if: steps.audit-dependencies.outputs.count > 0

- name: Create Pull Request
id: create-pull-request
if: steps.check-for-poetry-lock-changes.outputs.changed == 'true'
uses: peter-evans/create-pull-request@v7
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

In general, we try not to use third-party GitHub actions. This is because they can pose a security risk. Currently, we still use the a few third-party actions, like ravsamhq/notify-slack-action, as there isn't a GitHub equivalent.

So for the "Create Pull Request", we'd prefer to use the GitHub provided commands, so this should look mostly the same as:
https://github.com/exasol/project-keeper/blob/main/.github/workflows/dependencies_update.yml#L120

Though, we do not need to have as many initial checks as is provided in:
https://github.com/exasol/project-keeper/blob/main/.github/workflows/dependencies_update.yml#L132

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create a template workflow to execute poetry update

2 participants