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

fix(ci): multiline regex in change detection #13075

Merged
merged 2 commits into from
Feb 11, 2021

Conversation

villebro
Copy link
Member

@villebro villebro commented Feb 11, 2021

SUMMARY

Currently the CI test skipping logic applies a regex on a variable containing all modified files. As these checks are checking for start of line (^) and the regular =~ doesn't support multiline matching, the script has been changed to loop through each row in the changed files variable, and flag the first row where changes were detected.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TEST PLAN

Tested with a PR where changes weren't being picked up correctly:

$ GITHUB_REPO=apache/superset PR_NUMBER=13051 ./ci_check_no_file_changes.sh python
Searching for changes in python files

CHANGED FILES:
.github/workflows/docker_build_push.sh
superset/config.py
superset/connectors/sqla/views.py
superset/views/core.py
superset/views/datasource.py

Detected changes in following file: superset/config.py
Exiting with FAILURE code

Checking this PR:

$ GITHUB_REPO=apache/superset PR_NUMBER=13075 ./ci_check_no_file_changes.sh python frontend
Searching for changes in python files
Searching for changes in frontend files

CHANGED FILES:
scripts/ci_check_no_file_changes.sh

No changes detected... Exiting with SUCCESS code

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Requires DB Migration.
  • Confirm DB Migration upgrade and downgrade tested.
  • Introduces new feature or API
  • Removes existing feature or API

Copy link
Member

@dpgaspar dpgaspar left a comment

Choose a reason for hiding this comment

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

LGTM, just some shellcheck nit picking. What do you think about adding shellcheck to our CI?

@@ -44,11 +39,25 @@ do
echo "Invalid check: \"${CHECK}\". Falling back to exiting with FAILURE code"
exit 1
fi
REGEXES=(${REGEXES[@]} ${REGEX})
Copy link
Member

Choose a reason for hiding this comment

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

nit: shellcheck complains about:

  REGEXES=(${REGEXES[@]} ${REGEX})
           ^-----------^ SC2206: Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a.
                         ^------^ SC2206: Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a.


for FILE in ${FILES}
do
for REGEX in ${REGEXES[@]}
Copy link
Member

Choose a reason for hiding this comment

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

nit:

In 1.sh line 54:
  for REGEX in ${REGEXES[@]}
               ^-----------^ SC2068: Double quote array expansions to avoid re-splitting elements.

@pull-request-size pull-request-size bot added size/M and removed size/S labels Feb 11, 2021
@villebro
Copy link
Member Author

@dpgaspar fixed - I'm wondering if we should lint our scripts with ShellCheck? Seems like a good idea IMO

@villebro villebro merged commit ad380fd into apache:master Feb 11, 2021
amitmiran137 pushed a commit to nielsen-oss/superset that referenced this pull request Feb 14, 2021
* fix(ci): multiline regex in change detection

* fix shellcheck issues
amitmiran137 pushed a commit to nielsen-oss/superset that referenced this pull request Feb 14, 2021
* master: (30 commits)
  refactor(native-filters): decouple params from filter config modal (first phase) (apache#13021)
  fix(native-filters): set currentValue null when empty (apache#13000)
  Custom superset_config.py + secret envs (apache#13096)
  Update http error code from 400 to 403 (apache#13061)
  feat(native-filters): add storybook entry for select filter (apache#13005)
  feat(native-filters): Time native filter (apache#12992)
  Force pod restart on config changes (apache#13056)
  feat(cross-filters): add cross filters (apache#12662)
  fix(explore): Enable selecting an option not included in suggestions (apache#13029)
  Improves RTL configuration (apache#13079)
  Added a note about the ! prefix for breaking changes to CONTRIBUTING.md (apache#13083)
  chore: lock down npm to v6 (apache#13069)
  fix: API tests, make them possible to run independently again (apache#13076)
  fix: add config to disable dataset ownership on the old api (apache#13051)
  add required * indicator to message content/notif method (apache#12931)
  fix: Retroactively add granularity param to charts (apache#12960)
  fix(ci): multiline regex in change detection (apache#13075)
  feat(style): hide dashboard header by url parameter (apache#12918)
  fix(explore): pie chart label bugs (apache#13052)
  fix: Disabled state button transition time (apache#13008)
  ...
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.2.0 labels Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels preset-io size/M 🚢 1.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants