Skip to content

Commit 367abff

Browse files
committed
PR Feedback 1
1 parent 2cf6f51 commit 367abff

4 files changed

Lines changed: 12 additions & 9 deletions

File tree

docs/integrations/github.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
The GitHub Actions CI/CD Bot enables teams to automate their SQLMesh projects using GitHub Actions. It can be configured to perform the following things:
66

77
* Automatically run unit tests on PRs
8+
* Automatically run the linter on PRs
89
* Automatically create PR environments that represent the code changes in the PR
910
* Automatically categorize and backfill data for models that have changed
1011
* Automatically deploy changes to production with automatic data gap prevention and merge the PR
@@ -350,6 +351,7 @@ These can be used to potentially trigger follow up steps in the workflow.
350351
These are the possible outputs (based on how the bot is configured) that are created by the bot:
351352

352353
* `run_unit_tests`
354+
* `linter`
353355
* `has_required_approval`
354356
* `pr_environment_synced`
355357
* `prod_plan_preview`
@@ -373,6 +375,8 @@ In addition, there are custom outputs listed below:
373375
* `created_pr_environment` - set to `"true"` (a string with a value of `true`) if a PR environment was created for the first time. It is absent, or considered empty string if you check for it, if it is not created for the first time
374376
* `pr_environment_name` - the name of the PR environment. It is output whenever PR environment synced check reaches a conclusion. Therefore make sure to check the status of `created_pr_environment` or `pr_environment_synced` before acting on this output
375377

378+
Note: The `linter` step will run only if it's enabled in the project's configuration (`config.yaml` / `config.py`). The step will fail if the linter finds errors, otherwise it'll output only the warnings.
379+
376380
## Custom Workflow Configuration
377381
You can configure each individual action to run as a separate step. This can allow for more complex workflows or integrating specific steps with other actions you want to trigger. Run `sqlmesh_cicd github` to see a list of commands that can be supplied and their potential options.
378382
```bash
@@ -460,6 +464,10 @@ jobs:
460464
## Example Screenshots
461465
### Automated Unit Tests with Error Summary
462466
![Automated Unit Tests with Error Summary](github/github_test_summary.png)
467+
### Automated Linting with Error Summary
468+
![Automated Linting with Error Summary](github/linter_errors.png)
469+
### Automated Linting with Warning Summary
470+
![Automated Linting with Warning Summary](github/linter_warnings.png)
463471
### Automatically create PR Environments that represent the code changes in the PR
464472
![Environment Summary](github/github_env_summary.png)
465473
### Enforce that certain reviewers have approved of the PR before it can be merged
336 KB
Loading
279 KB
Loading

tests/integrations/github/cicd/test_integration.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,12 @@ def test_linter(
6363
mocker: MockerFixture,
6464
):
6565
"""
66-
PR with a non-breaking change and auto-categorization will be backfilled, merged, and deployed to prod
66+
PR with the Linter enabled will contain a new check with the linter specific output.
6767
68-
Scenario:
69-
- PR is not merged
70-
- PR has been approved by a required reviewer
71-
- Tests passed
72-
- PR Merge Method defined
73-
- Delete environment is disabled
74-
- Changes made in PR with auto-categorization
68+
Scenarios:
69+
- PR with linter errors leads to job failures & skips
70+
- PR with linter warnings leads to job successes
7571
"""
76-
7772
mock_repo = github_client.get_repo()
7873
mock_repo.create_check_run = mocker.MagicMock(
7974
side_effect=lambda **kwargs: make_mock_check_run(**kwargs)

0 commit comments

Comments
 (0)