Skip to content
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

Better diagnostics in case someone modified the dependencies file #24763

Merged
merged 1 commit into from
Jul 1, 2022
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
22 changes: 22 additions & 0 deletions .github/workflows/build-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,17 @@ jobs:
- run: ./scripts/ci/install_breeze.sh
- name: "Free space"
run: breeze free-space
- name: Cache pre-commit envs
uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: "pre-commit-${{steps.host-python-version.outputs.host-python-version}}-\
${{ hashFiles('.pre-commit-config.yaml') }}"
restore-keys: pre-commit-${{steps.host-python-version.outputs.host-python-version}}
- name: "Regenerate dependencies in case they was modified manually so that we can build an image"
run: >
breeze static-checks --type update-providers-dependencies --all-files
--show-diff-on-failure --color always || true
- name: >
Build & Push AMD64 CI images ${{ env.IMAGE_TAG_FOR_THE_BUILD }}
${{ needs.build-info.outputs.allPythonVersionsListAsString }}
Expand Down Expand Up @@ -316,6 +327,17 @@ jobs:
- run: ./scripts/ci/install_breeze.sh
- name: "Free space"
run: breeze free-space
- name: Cache pre-commit envs
uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: "pre-commit-${{steps.host-python-version.outputs.host-python-version}}-\
${{ hashFiles('.pre-commit-config.yaml') }}"
restore-keys: pre-commit-${{steps.host-python-version.outputs.host-python-version}}
- name: "Regenerate dependencies in case they was modified manually so that we can build an image"
run: >
breeze static-checks --type update-providers-dependencies --all-files
--show-diff-on-failure --color always || true
- name: >
Pull CI image for PROD build:
${{ needs.build-info.outputs.defaultPythonVersion }}:${{ env.IMAGE_TAG_FOR_THE_BUILD }}
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,18 @@ jobs:
- name: "Free space"
run: breeze free-space
if: needs.build-info.outputs.inWorkflowBuild == 'true'
- name: Cache pre-commit envs
uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: "pre-commit-${{steps.host-python-version.outputs.host-python-version}}-\
${{ hashFiles('.pre-commit-config.yaml') }}"
restore-keys: pre-commit-${{steps.host-python-version.outputs.host-python-version}}
- name: "Regenerate dependencies in case they was modified manually so that we can build an image"
run: >
breeze static-checks --type update-providers-dependencies --all-files
--show-diff-on-failure --color always || true
if: needs.build-info.outputs.inWorkflowBuild == 'true'
- name: >
Build & Push CI images ${{ env.IMAGE_TAG_FOR_THE_BUILD }}
${{ needs.build-info.outputs.allPythonVersionsListAsString }}
Expand Down Expand Up @@ -402,6 +414,18 @@ jobs:
- name: "Free space"
run: breeze free-space
if: needs.build-info.outputs.inWorkflowBuild == 'true'
- name: Cache pre-commit envs
uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: "pre-commit-${{steps.host-python-version.outputs.host-python-version}}-\
${{ hashFiles('.pre-commit-config.yaml') }}"
restore-keys: pre-commit-${{steps.host-python-version.outputs.host-python-version}}
- name: "Regenerate dependencies in case they was modified manually so that we can build an image"
run: >
breeze static-checks --type update-providers-dependencies --all-files
--show-diff-on-failure --color always || true
if: needs.build-info.outputs.inWorkflowBuild == 'true'
- name: >
Pull CI image for PROD build:
${{ needs.build-info.outputs.defaultPythonVersion }}:${{ env.IMAGE_TAG_FOR_THE_BUILD }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@ def check_if_different_provider_used(file_path: Path) -> None:
console.print()
sys.exit(1)
DEPENDENCIES_JSON_FILE_PATH.write_text(json.dumps(unique_sorted_dependencies, indent=2) + "\n")
console.print(
f"[yellow]If you see changes to the {DEPENDENCIES_JSON_FILE_PATH} file - "
f"do not modify the file manually. Let pre-commit do the job!"
)
console.print()
console.print("[green]Verification complete! Success!\n")
console.print(f"Written {DEPENDENCIES_JSON_FILE_PATH}")
Expand Down