-
Notifications
You must be signed in to change notification settings - Fork 2
Documentation/721 add workflow generate #724
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
28d54b9
Tiny fix ups
ArBridgeman 6e30580
Ensure workflow:generate works for newly created project
ArBridgeman 8f68807
Give basic text start
ArBridgeman 9b43d11
Split up API into sub-files & fix so BaseConfig can be viewed
ArBridgeman 28f7e40
Add small text description for
ArBridgeman 9afecf8
Add workflow_patcher page
ArBridgeman 68a25b9
Add autodoc_pydantic
ArBridgeman 2d99932
Add model to API
ArBridgeman 217d4d6
Modify changelog
ArBridgeman 5f17d70
Merge branch 'main' into documentation/720_add_workflow_generate
ArBridgeman 4019d3f
Remove addition as not so useful without the field annotation
ArBridgeman 55892cb
Apply review comments & fix another date
ArBridgeman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| .. _base_config: | ||
|
|
||
| BaseConfig | ||
| ========== | ||
|
|
||
| .. currentmodule:: exasol.toolbox.config | ||
|
|
||
| .. autoclass:: BaseConfig | ||
| :members: | ||
| :undoc-members: | ||
| :show-inheritance: | ||
| :member-order: bysource | ||
| :special-members: __init__ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| .. _api: | ||
|
|
||
| :octicon:`cpu` API Reference | ||
| ============================= | ||
|
|
||
| .. toctree:: | ||
| :maxdepth: 2 | ||
|
|
||
| base_config | ||
| workflow_exceptions | ||
| workflow_patcher_config |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| .. _workflow_patcher_config: | ||
|
|
||
| WorkflowPatcherConfig | ||
| ===================== | ||
|
|
||
| .. currentmodule:: exasol.toolbox.util.workflows.patch_workflow | ||
|
|
||
| .. autoclass:: WorkflowPatcherConfig | ||
| :members: | ||
| :undoc-members: | ||
| :show-inheritance: | ||
| :member-order: bysource | ||
| :special-members: __init__ | ||
|
|
||
| .. autoclass:: Workflow | ||
| :members: | ||
| :undoc-members: | ||
| :show-inheritance: | ||
| :member-order: bysource | ||
| :special-members: __init__ | ||
|
|
||
| .. autoclass:: StepCustomization | ||
| :members: | ||
| :undoc-members: | ||
| :show-inheritance: | ||
| :member-order: bysource | ||
| :special-members: __init__ | ||
|
|
||
| .. autoclass:: StepContent | ||
| :members: | ||
| :undoc-members: | ||
| :show-inheritance: | ||
| :member-order: bysource | ||
| :special-members: __init__ | ||
|
|
||
| .. autofunction:: validate_workflow_name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
doc/user_guide/features/github_workflows/workflow_patcher.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| .. _workflow_patcher: | ||
|
|
||
| Workflow Patcher | ||
| ================ | ||
|
|
||
| Underlying the CLI, the PTB uses, if defined, a ``.workflow_patcher.yml`` file to | ||
| customize generated project-specific workflows. The rendering process is supported by | ||
| the ``github_workflow_patcher_yaml`` found in your ``noxconfig.py::PROJECT_CONFIG``. | ||
| This filepath is inherited by default from | ||
| :py:attr:`exasol.toolbox.config.BaseConfig.github_workflow_patcher_yaml` | ||
| ensuring a standardized baseline that can be easily overridden, if necessary. | ||
|
|
||
| .. literalinclude:: ../../../../exasol/toolbox/config.py | ||
| :language: python | ||
| :start-at: github_workflow_patcher_yaml | ||
|
|
||
| Model | ||
| ------- | ||
|
|
||
| .. code-block:: yaml | ||
|
|
||
| workflows: | ||
| - name: pr-merge | ||
| remove_jobs: | ||
| - publish-docs | ||
| step_customizations: | ||
| - action: REPLACE | INSERT_AFTER | ||
| job: run-unit-tests | ||
| step_id: check-out-repository | ||
| content: | ||
| - name: Check out Repository | ||
| id: check-out-repository | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
|
|
||
| * ``name``: Name of the GitHub workflow to customize. The PTB supports these workflows: | ||
| `exasol/toolbox/templates/github/workflows <https://github.com/exasol/python-toolbox/tree/main/exasol/toolbox/templates/github/workflows>`__. | ||
| * ``remove_jobs``: List of job names to remove from the workflow. | ||
| This is useful when a job like ``publish-docs`` is not applicable for a project. | ||
| * ``step_customizations``: List of customizations: | ||
|
|
||
| * ``action``: Type of customization | ||
|
|
||
| * ``REPLACE``: Replace an existing step with the new content | ||
| * ``INSERT_AFTER``: Insert the content **after** the specified step | ||
|
|
||
| * ``job``: Name of the job inside the workflow that should be modified, e.g. ``run-unit-tests``. | ||
| * ``step_id``: ID of the step to replace or after which to insert the new step | ||
| * ``content``: Content of the new step. The PTB does not validate that this will work on | ||
| GitHub, but it does validate that it is valid YAML content. | ||
|
|
||
| .. note:: | ||
|
|
||
| For more information, see the API documentation for | ||
| :class:`exasol.toolbox.util.workflows.patch_workflow.WorkflowPatcherConfig`. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.