-
Notifications
You must be signed in to change notification settings - Fork 471
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into sdkv3/startMigration
- Loading branch information
Showing
40 changed files
with
624 additions
and
211 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,86 +1,86 @@ | ||
# github actions: https://docs.github.com/en/actions/use-cases-and-examples/building-and-testing/building-and-testing-nodejs | ||
# setup-node: https://github.com/actions/setup-node | ||
# # github actions: https://docs.github.com/en/actions/use-cases-and-examples/building-and-testing/building-and-testing-nodejs | ||
# # setup-node: https://github.com/actions/setup-node | ||
|
||
name: Copy-Paste Detection | ||
# name: Copy-Paste Detection | ||
|
||
on: | ||
pull_request: | ||
branches: [master, feature/*, staging] | ||
# on: | ||
# pull_request: | ||
# branches: [master, feature/*, staging] | ||
|
||
jobs: | ||
jscpd: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [18.x] | ||
env: | ||
NODE_OPTIONS: '--max-old-space-size=8192' | ||
# jobs: | ||
# jscpd: | ||
# runs-on: ubuntu-latest | ||
# strategy: | ||
# matrix: | ||
# node-version: [18.x] | ||
# env: | ||
# NODE_OPTIONS: '--max-old-space-size=8192' | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# with: | ||
# fetch-depth: 0 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
# - name: Use Node.js ${{ matrix.node-version }} | ||
# uses: actions/setup-node@v4 | ||
# with: | ||
# node-version: ${{ matrix.node-version }} | ||
|
||
- name: Fetch fork upstream | ||
run: | | ||
git remote add forkUpstream https://github.com/${{ github.event.pull_request.head.repo.full_name }} # URL of the fork | ||
git fetch forkUpstream # Fetch fork | ||
# - name: Fetch fork upstream | ||
# run: | | ||
# git remote add forkUpstream https://github.com/${{ github.event.pull_request.head.repo.full_name }} # URL of the fork | ||
# git fetch forkUpstream # Fetch fork | ||
|
||
- name: Determine base and target branches for comparison. | ||
run: | | ||
echo "CURRENT_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV | ||
echo "TARGET_BRANCH=${{ github.event.pull_request.base.ref }}" >> $GITHUB_ENV | ||
- run: git diff --name-only origin/$TARGET_BRANCH forkUpstream/$CURRENT_BRANCH > diff_output.txt | ||
- run: | | ||
npm install -g jscpd | ||
# - name: Determine base and target branches for comparison. | ||
# run: | | ||
# echo "CURRENT_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV | ||
# echo "TARGET_BRANCH=${{ github.event.pull_request.base.ref }}" >> $GITHUB_ENV | ||
# - run: git diff --name-only origin/$TARGET_BRANCH forkUpstream/$CURRENT_BRANCH > diff_output.txt | ||
# - run: | | ||
# npm install -g jscpd | ||
|
||
- run: jscpd --config "$GITHUB_WORKSPACE/.github/workflows/jscpd.json" | ||
# - run: jscpd --config "$GITHUB_WORKSPACE/.github/workflows/jscpd.json" | ||
|
||
- if: always() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: unfiltered-jscpd-report | ||
path: ./jscpd-report.json | ||
# - if: always() | ||
# uses: actions/upload-artifact@v4 | ||
# with: | ||
# name: unfiltered-jscpd-report | ||
# path: ./jscpd-report.json | ||
|
||
- name: Filter jscpd report for changed files | ||
run: | | ||
if [ ! -f ./jscpd-report.json ]; then | ||
echo "jscpd-report.json not found" | ||
exit 1 | ||
fi | ||
echo "Filtering jscpd report for changed files..." | ||
CHANGED_FILES=$(jq -R -s -c 'split("\n")[:-1]' diff_output.txt) | ||
echo "Changed files: $CHANGED_FILES" | ||
jq --argjson changed_files "$CHANGED_FILES" ' | ||
.duplicates | map(select( | ||
(.firstFile?.name as $fname | $changed_files | any(. == $fname)) or | ||
(.secondFile?.name as $sname | $changed_files | any(. == $sname)) | ||
)) | ||
' ./jscpd-report.json > filtered-jscpd-report.json | ||
cat filtered-jscpd-report.json | ||
# - name: Filter jscpd report for changed files | ||
# run: | | ||
# if [ ! -f ./jscpd-report.json ]; then | ||
# echo "jscpd-report.json not found" | ||
# exit 1 | ||
# fi | ||
# echo "Filtering jscpd report for changed files..." | ||
# CHANGED_FILES=$(jq -R -s -c 'split("\n")[:-1]' diff_output.txt) | ||
# echo "Changed files: $CHANGED_FILES" | ||
# jq --argjson changed_files "$CHANGED_FILES" ' | ||
# .duplicates | map(select( | ||
# (.firstFile?.name as $fname | $changed_files | any(. == $fname)) or | ||
# (.secondFile?.name as $sname | $changed_files | any(. == $sname)) | ||
# )) | ||
# ' ./jscpd-report.json > filtered-jscpd-report.json | ||
# cat filtered-jscpd-report.json | ||
|
||
- name: Check for duplicates | ||
run: | | ||
if [ $(wc -l < ./filtered-jscpd-report.json) -gt 1 ]; then | ||
echo "filtered_report_exists=true" >> $GITHUB_ENV | ||
else | ||
echo "filtered_report_exists=false" >> $GITHUB_ENV | ||
fi | ||
- name: upload filtered report (if applicable) | ||
if: env.filtered_report_exists == 'true' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: filtered-jscpd-report | ||
path: ./filtered-jscpd-report.json | ||
# - name: Check for duplicates | ||
# run: | | ||
# if [ $(wc -l < ./filtered-jscpd-report.json) -gt 1 ]; then | ||
# echo "filtered_report_exists=true" >> $GITHUB_ENV | ||
# else | ||
# echo "filtered_report_exists=false" >> $GITHUB_ENV | ||
# fi | ||
# - name: upload filtered report (if applicable) | ||
# if: env.filtered_report_exists == 'true' | ||
# uses: actions/upload-artifact@v4 | ||
# with: | ||
# name: filtered-jscpd-report | ||
# path: ./filtered-jscpd-report.json | ||
|
||
- name: Fail and log found duplicates. | ||
if: env.filtered_report_exists == 'true' | ||
run: | | ||
cat ./filtered-jscpd-report.json | ||
echo "Duplications found, failing the check." | ||
exit 1 | ||
# - name: Fail and log found duplicates. | ||
# if: env.filtered_report_exists == 'true' | ||
# run: | | ||
# cat ./filtered-jscpd-report.json | ||
# echo "Duplications found, failing the check." | ||
# exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
version: 0.2 | ||
|
||
phases: | ||
install: | ||
runtime-versions: | ||
nodejs: 16 | ||
|
||
pre_build: | ||
commands: | ||
- STAGE_NAME=SourceWithGit | ||
- PIPELINE=$(echo $CODEBUILD_INITIATOR | sed -e 's/codepipeline\///') | ||
build: | ||
commands: | ||
- | | ||
aws codepipeline enable-stage-transition \ | ||
--pipeline-name "$PIPELINE" \ | ||
--stage-name "$STAGE_NAME" \ | ||
--transition-type "Inbound" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"date": "2024-11-27", | ||
"version": "1.38.0", | ||
"entries": [ | ||
{ | ||
"type": "Feature", | ||
"description": "Amazon Q /dev: support `Dockerfile` files" | ||
}, | ||
{ | ||
"type": "Feature", | ||
"description": "Introduce @workspace command to enhance context fetching for Chat" | ||
}, | ||
{ | ||
"type": "Feature", | ||
"description": "Feature(Amazon Q Code Transformation): allow users to view results in 5 smaller diffs" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.