Skip to content

Feature/831 no longer overwrite slow checks#834

Open
ArBridgeman wants to merge 14 commits into
mainfrom
feature/831_no_longer_overwrite_slow_checks
Open

Feature/831 no longer overwrite slow checks#834
ArBridgeman wants to merge 14 commits into
mainfrom
feature/831_no_longer_overwrite_slow_checks

Conversation

@ArBridgeman
Copy link
Copy Markdown
Collaborator

closes #831

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 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?

@ArBridgeman ArBridgeman temporarily deployed to manual-approval May 12, 2026 11:59 — with GitHub Actions Inactive
Comment thread doc/user_guide/features/github_workflows/index.rst
@ArBridgeman ArBridgeman deployed to manual-approval May 13, 2026 07:27 — with GitHub Actions Active
Comment thread doc/user_guide/features/github_workflows/index.rst
Comment thread doc/user_guide/features/github_workflows/index.rst
)

try:
validate_workflow_name(workflow_name, allow_not_maintained=is_new_project)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I have the feeling, that passing this option to validate_workflow_name() and later on catching the exception NotMaintainedWorkflowError is somewhat complicated / redundant and awkward.

Could we maybe

  • not pass arg allow_not_maintained to validate_workflow_name()
  • in except NotMaintainedWorkflowError: check if it is a new project and only print the log message for old projects


underlying_error = ex.value.__cause__
assert isinstance(underlying_error, ValidationError)
assert "workflows.0.name" in str(underlying_error)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Shouldn't this test verify NOT_MAINTAINED_WORKFLOW_NAMES[0] rather than "workflows.0.name"?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also, I am not sure whether the name of the test matches the content.
Shouldn't not_maintained_workflow_name raise an NotMaintainedWorkflowError rather than InvalidWorkflowPatcherYamlError?

Copy link
Copy Markdown
Collaborator Author

@ArBridgeman ArBridgeman May 13, 2026

Choose a reason for hiding this comment

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

In this test, because it involves the pydantic model, the ValidationError is the one causing the issue.

So we have:

  1. NotMaintainedWorkflowError -> this is our actual issue
  2. This is caught internally by pydantic which raises a ValidationError -> this is just pydantic being pydantic. It usually does this as the model might have multiple errors, and we don't want to break on just the 1st one.
  3. We catch this and raise an InvalidWorkflowPatcherYamlError -> this tells you which file had issues
image

Copy link
Copy Markdown
Collaborator Author

@ArBridgeman ArBridgeman May 13, 2026

Choose a reason for hiding this comment

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

I ended up modifying the exception to display some more information, as in another issue, it was stated that it got cut off.

image

@staticmethod
@pytest.mark.parametrize("workflow_name", NOT_MAINTAINED_WORKFLOW_NAMES)
def test_works_as_expected_for_old_project_where_not_maintained_workflows_skipped(
project_config_without_patcher, workflow_name
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Shouldn't this test maybe verify, that the file content remains unchanged?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I can modify the test to do that.

My purpose here was to show that if an old project exists, which is determined by any *.yml being present in the .github/workflows directory, that slow-checks.yml wouldn't be added to it.

Comment thread test/unit/util/workflows/workflow_test.py Outdated
@sonarqubecloud
Copy link
Copy Markdown

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.

No longer overwrite slow-checks.yml

3 participants