Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/build-and-publish.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .github/workflows/cd.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .github/workflows/check-release-tag.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .github/workflows/checks.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .github/workflows/ci.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 10 additions & 8 deletions .github/workflows/dependency-update.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .github/workflows/fast-tests.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .github/workflows/gh-pages.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .github/workflows/matrix.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .github/workflows/merge-gate.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .github/workflows/periodic-validation.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .github/workflows/pr-merge.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .github/workflows/report.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions doc/changes/unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
## Refactoring

* #924: Removed the deprecated `lint:dependencies` Nox session and its unused implementation and tests.
* #972: Switched from ravsamhq/notify-slack-action to maintained slackapi/slack-github-action & removed workflow versioned header
10 changes: 3 additions & 7 deletions exasol/toolbox/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,15 @@
)
from pydantic_core.core_schema import ValidationInfo

from exasol.toolbox import __version__
from exasol.toolbox.nox.plugin import (
METHODS_SPECIFIED_FOR_HOOKS,
PLUGIN_ATTR_NAME,
)
from exasol.toolbox.util.version import Version
from exasol.toolbox.util.workflows.render_yaml import GithubTemplateContext

WORKFLOW_HEADER_PREFIX = (
"# Generated and maintained by the exasol-toolbox.\n"
"# Last generated with exasol-toolbox version "
)
WORKFLOW_HEADER_PATTERN = rf"\A{re.escape(WORKFLOW_HEADER_PREFIX)}[^\n]+\.\n"
WORKFLOW_HEADER_PREFIX = "# Generated and maintained by the exasol-toolbox."
WORKFLOW_HEADER_PATTERN = rf"\A{re.escape(WORKFLOW_HEADER_PREFIX)}\n"


def get_methods_with_hook_implementation(
Expand Down Expand Up @@ -348,7 +344,7 @@ def github_template_dict(self) -> GithubTemplateContext:
os_version=self.os_version,
python_versions=self.python_versions,
sonar_token_name=self.sonar_token_name,
workflow_header=f"{WORKFLOW_HEADER_PREFIX}{__version__}.",
workflow_header=WORKFLOW_HEADER_PREFIX,
)

@computed_field # type: ignore[misc]
Expand Down
17 changes: 10 additions & 7 deletions exasol/toolbox/templates/github/workflows/dependency-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,14 @@ jobs:
- name: Report New Pull Request to Slack Channel
id: report-pr-slack
if: ${{ steps.create-pr.outputs.pr_url }}
uses: ravsamhq/notify-slack-action@be814b201e233b2dc673608aa46e5447c8ab13f2 # 2.5.0
uses: slackapi/slack-github-action@dcb1066f776dd043e64d0e8ba94ca15cc7e1875d # v4.0.0
Comment thread
ArBridgeman marked this conversation as resolved.
with:
status: '${{ job.status }}'
token: '${{ secrets.GITHUB_TOKEN }}'
notification_title: 'Dependency update for {repo} created a Pull Request'
message_format: '{workflow} created Pull Request ${{ steps.create-pr.outputs.pr_url }}'
env:
SLACK_WEBHOOK_URL: '${{ secrets.INTEGRATION_TEAM_SECURITY_UPDATES_WEBHOOK }}'
webhook: ${{ secrets.INTEGRATION_TEAM_SECURITY_UPDATES_WEBHOOK }}
webhook-type: incoming-webhook
payload: |-
text: "Dependency update for ${{ github.repository }} created a Pull Request: ${{ steps.create-pr.outputs.pr_url }}"
blocks:
- type: section
text:
type: mrkdwn
text: "*Dependency update for `${{ github.repository }}` created a Pull Request*\n<${{ steps.create-pr.outputs.pr_url }}|View Pull Request>"
4 changes: 3 additions & 1 deletion test/integration/util/dependencies/audit_integration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ def test_poetry_export_versions(self, create_export_poetry_project, tmp_path):
)

content = requirements_txt.read_text()
assert self.extract_package_names(content) == EXPORT_PACKAGES
# Poetry may emit a package more than once when it is shared by multiple
# dependency groups or extras.
assert set(self.extract_package_names(content)) == set(EXPORT_PACKAGES)
assert "--hash=" in content


Expand Down
6 changes: 1 addition & 5 deletions test/unit/config_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import re
from collections.abc import Iterable
from pathlib import Path
from unittest.mock import Mock
Expand Down Expand Up @@ -35,10 +34,7 @@ def test_works_as_defined(tmp_path, test_project_config_factory):
root_path = config.root_path
config_dump = config.model_dump()
workflow_header = config_dump["github_template_dict"].pop("workflow_header")
assert re.sub(r"version [^\n]+\.", "version X.Y.Z.", workflow_header) == (
"# Generated and maintained by the exasol-toolbox.\n"
"# Last generated with exasol-toolbox version X.Y.Z."
)
assert workflow_header == "# Generated and maintained by the exasol-toolbox."
assert config_dump == {
"add_to_excluded_python_paths": (),
"create_major_version_tags": False,
Expand Down
6 changes: 3 additions & 3 deletions test/unit/util/workflows/workflow_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ class TestNormalizeContent:
@staticmethod
def test_strips_workflow_header_when_requested():
content = (
f"{WORKFLOW_HEADER_PREFIX}8.0.0.\n\n"
f"{WORKFLOW_HEADER_PREFIX}\n\n"
"jobs:\n"
" build:\n"
" runs-on: ubuntu-24.04\n"
Expand All @@ -226,14 +226,14 @@ def test_strips_workflow_header_when_requested():
@staticmethod
def test_keeps_workflow_header_when_not_requested():
content = (
f"{WORKFLOW_HEADER_PREFIX}8.0.0.\n\n"
f"{WORKFLOW_HEADER_PREFIX}\n\n"
"jobs:\n"
" build:\n"
" runs-on: ubuntu-24.04\n"
)

assert Workflow._normalize_content(content, strip_header=False) == (
f"{WORKFLOW_HEADER_PREFIX}8.0.0.\n\n"
f"{WORKFLOW_HEADER_PREFIX}\n\n"
"jobs:\n"
" build:\n"
" runs-on: ubuntu-24.04"
Expand Down