-
Notifications
You must be signed in to change notification settings - Fork 4.5k
chore: Check for cyclic dependencies only for client file changes in a PR #34154
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
Changes from all commits
cb488b5
36c0d13
77974fa
141f00a
f1b353c
4137b90
dc5b8f9
83d6a9c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,27 +27,40 @@ jobs: | |
| with: | ||
| ref: refs/pull/${{ inputs.pr }}/merge | ||
|
|
||
| - name: Check for changes in app/client/src | ||
| id: changed-files | ||
| uses: tj-actions/changed-files@v41 | ||
| with: | ||
| files: | | ||
| app/client/src/** | ||
|
|
||
| - name: Count circular dependencies on PR branch | ||
| id: count-cyclic-deps-in-pr | ||
| if: steps.changed-files.outputs.any_changed == 'true' | ||
| run: | | ||
| npx dpdm ./src/* --circular --warning=false --tree=false > pr_circular_deps.txt | ||
| pr_count=$(cat pr_circular_deps.txt | wc -l) | ||
| echo "pr_count=$pr_count" >> $GITHUB_OUTPUT | ||
| cat pr_circular_deps.txt | ||
|
|
||
| - name: Checkout release branch | ||
| uses: actions/checkout@v4 | ||
| if: steps.changed-files.outputs.any_changed == 'true' | ||
| with: | ||
| ref: release | ||
|
|
||
| - name: Count circular dependencies on release branch | ||
| id: coun-cyclic-deps-in-release | ||
| if: steps.changed-files.outputs.any_changed == 'true' | ||
| run: | | ||
| npx dpdm ./src/* --circular --warning=false --tree=false > release_circular_deps.txt | ||
| release_count=$(cat release_circular_deps.txt | wc -l) | ||
| echo "release_count=$release_count" >> $GITHUB_OUTPUT | ||
| cat release_circular_deps.txt | ||
|
|
||
| - name: Compare circular dependencies | ||
| id: compare-deps | ||
| if: steps.changed-files.outputs.any_changed == 'true' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tip Codebase Verification The comparison logic in the workflow file appears to have a typo in the variable name for the release count. Specifically,
This typo would prevent the comparison logic from functioning correctly, as it would not be able to retrieve the correct count of circular dependencies from the release branch. Analysis chainEnsure accurate comparison logic. The comparison logic is critical for determining if the PR has introduced more cyclic dependencies. It's important to ensure that this logic accurately reflects the differences. Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Verify the comparison logic between PR and release branch counts.
# Test: Simulate different scenarios to ensure the comparison logic correctly identifies changes in cyclic dependencies.
echo "Simulating with different counts..."
# Assuming a function or script to simulate this.
Length of output: 80 Script: #!/bin/bash
# Extract the relevant steps in the workflow file that handle the comparison logic
workflow_file=".github/workflows/ci-client-cyclic-deps-check.yml"
# Display the lines around the comparison logic to understand the context
grep -A 5 -B 5 "steps.changed-files.outputs.any_changed == 'true'" "$workflow_file"
Length of output: 2086 Script: #!/bin/bash
# Extract the comparison step to verify variable usage and output setting
workflow_file=".github/workflows/ci-client-cyclic-deps-check.yml"
# Display the lines around the comparison step to understand the context
grep -A 5 -B 5 "id: compare-deps" "$workflow_file"
Length of output: 672 |
||
| run: | | ||
| release_count=${{ steps.coun-cyclic-deps-in-release.outputs.release_count }} | ||
| pr_count=${{ steps.count-cyclic-deps-in-pr.outputs.pr_count }} | ||
|
|
@@ -60,7 +73,7 @@ jobs: | |
|
|
||
| # Comment on the PR if cyclic dependencies are found | ||
| - name: Comment the result on PR | ||
| if: steps.compare-deps.outputs.has_more_cyclic_deps == 'true' | ||
| if: steps.compare-deps.outputs.has_more_cyclic_deps == 'true' && steps.changed-files.outputs.any_changed == 'true' | ||
| uses: actions/github-script@v3 | ||
| with: | ||
| github-token: ${{secrets.GITHUB_TOKEN}} | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.