Skip to content

improve lint workflow to avoid fast fail#1378

Merged
joshuali925 merged 1 commit intoopensearch-project:mainfrom
joshuali925:improve-lint
Jan 24, 2024
Merged

improve lint workflow to avoid fast fail#1378
joshuali925 merged 1 commit intoopensearch-project:mainfrom
joshuali925:improve-lint

Conversation

@joshuali925
Copy link
Copy Markdown
Member

@joshuali925 joshuali925 commented Jan 22, 2024

Description

make it fail after linting all files

Issues Resolved

#1369 (comment)

Check List

  • New functionality includes testing.
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented.
    • New functionality has javadoc added
    • New functionality has user manual doc added
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Joshua Li <joshuali925@gmail.com>
jq -r '.[]' ${HOME}/files_modified.json ${HOME}/files_added.json | sort | uniq > /tmp/changed_files.txt
CHANGED_FILES=$(cat /tmp/changed_files.txt)
echo "These are the changed files: $CHANGED_FILES"
CHANGED_FILES=($(jq -r '.[]' ${HOME}/files_modified.json ${HOME}/files_added.json | grep '.\+.\(js\|ts\|tsx\)$' | sort -u))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I remember one of the issues we were trying to tackle was when a file is renamed, both 'modified' and 'added' shas will show the same renamed file which lead to later lint that file more than once, is it? @RyanL1997 , is this considered in the new change as I saw uniq was removed?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

prefer sort -u over sort | uniq. they have the same output

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@mengweieric Yes, that shouldn't be a problem. Since the above step Check Changes of Files has filtered the output

@RyanL1997 RyanL1997 added the enhancement New feature or request label Jan 23, 2024
@joshuali925 joshuali925 merged commit e3116ca into opensearch-project:main Jan 24, 2024
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jan 24, 2024
Signed-off-by: Joshua Li <joshuali925@gmail.com>
(cherry picked from commit e3116ca)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
sejli pushed a commit to sejli/dashboards-observability that referenced this pull request Jan 26, 2024
Signed-off-by: Joshua Li <joshuali925@gmail.com>
mengweieric pushed a commit that referenced this pull request Jan 30, 2024
(cherry picked from commit e3116ca)

Signed-off-by: Joshua Li <joshuali925@gmail.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
paulstn pushed a commit to paulstn/dashboards-observability that referenced this pull request Feb 1, 2024
Signed-off-by: Joshua Li <joshuali925@gmail.com>
amsiglan pushed a commit to amsiglan/dashboards-observability that referenced this pull request Jun 7, 2024
…pensearch-project#1384)

(cherry picked from commit e3116ca)

Signed-off-by: Joshua Li <joshuali925@gmail.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
(cherry picked from commit 305e037)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport 2.x enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants