Skip to content

Commit 874eb41

Browse files
author
Alexey Temnikov
committed
Merge remote-tracking branch 'origin/muaydin/docdb-polling-bug-fix' into muaydin/docdb-polling-bug-fix
2 parents 60a5da4 + d8b3673 commit 874eb41

File tree

300 files changed

+6304
-3672
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

300 files changed

+6304
-3672
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Bug Fix",
3+
"description": "Resource Explorer: S3 tree view now shows bucket contents correctly, even when restricted to root prefix."
4+
}

.eslintrc.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,15 @@ module.exports = {
206206
message:
207207
'Avoid child_process, use ChildProcess from `shared/utilities/processUtils.ts` instead.',
208208
},
209+
{
210+
name: '..',
211+
message:
212+
'Avoid importing from index.ts files as it can lead to circular dependencies. Import from the module directly instead.',
213+
},
209214
],
210215
},
211216
],
217+
218+
'prettier/prettier': ['error', { endOfLine: 'auto' }],
212219
},
213220
}

.github/workflows/filterDuplicates.js

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* the program exits with an error and logs the filtered report to console.
55
*
66
* Usage:
7-
* node filterDuplicates.js run [path_to_git_diff] [path_to_jscpd_report]
7+
* node filterDuplicates.js run [path_to_git_diff] [path_to_jscpd_report] [commit_hash] [repo_name]
88
*
99
* Tests:
1010
* node filterDuplicates.js test
@@ -84,25 +84,40 @@ function filterDuplicates(report, changes) {
8484
return duplicates
8585
}
8686

87+
function formatDuplicates(duplicates, commitHash, repoName) {
88+
const baseUrl = `https://github.com/${repoName}`
89+
return duplicates.map((dupe) => {
90+
return {
91+
first: formUrl(dupe.firstFile, commitHash),
92+
second: formUrl(dupe.secondFile, commitHash),
93+
numberOfLines: dupe.lines,
94+
}
95+
})
96+
function formUrl(file, commitHash) {
97+
return `${baseUrl}/blob/${commitHash}/${file.name}#L${file.start}-L${file.end}`
98+
}
99+
}
100+
87101
async function run() {
88102
const rawDiffPath = process.argv[3]
89103
const jscpdReportPath = process.argv[4]
104+
const commitHash = process.argv[5]
105+
const repoName = process.argv[6]
90106
const changes = await parseDiff(rawDiffPath)
91107
const jscpdReport = JSON.parse(await fs.readFile(jscpdReportPath, 'utf8'))
92108
const filteredDuplicates = filterDuplicates(jscpdReport, changes)
93109

94110
console.log('%s files changes', changes.size)
95111
console.log('%s duplicates found', filteredDuplicates.length)
96112
if (filteredDuplicates.length > 0) {
97-
console.log(filteredDuplicates)
113+
console.log(formatDuplicates(filteredDuplicates, commitHash, repoName))
98114
process.exit(1)
99115
}
100116
}
101117

102118
/**
103119
* Mini-test Suite
104120
*/
105-
console.log(__dirname)
106121
const testDiffFile = path.resolve(__dirname, 'test/test_diff.txt')
107122
let testCounter = 0
108123
function assertEqual(actual, expected) {

.github/workflows/node.js.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
- run: npm run testCompile
5858
- run: npm run lint
5959

60-
jscpd:
60+
lint-duplicate-code:
6161
needs: lint-commits
6262
if: ${{ github.event_name == 'pull_request'}}
6363
runs-on: ubuntu-latest
@@ -101,7 +101,10 @@ jobs:
101101
path: ./jscpd-report.json
102102

103103
- name: Check for Duplicates
104-
run: node "$GITHUB_WORKSPACE/.github/workflows/filterDuplicates.js" run diff_output.txt jscpd-report.json
104+
env:
105+
COMMIT_HASH: ${{ github.sha}}
106+
REPO_NAME: ${{ github.repository }}
107+
run: node "$GITHUB_WORKSPACE/.github/workflows/filterDuplicates.js" run diff_output.txt jscpd-report.json $COMMIT_HASH $REPO_NAME
105108

106109
macos:
107110
needs: lint-commits

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ packages/amazonq/package.nls.json
4747
packages/amazonq/resources
4848

4949
# Icons
50-
packages/*/resources/icons/cloud9/generated/**
5150
packages/*/resources/fonts/aws-toolkit-icons.woff
5251
packages/*/resources/css/icons.css
5352

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ If you are contribuing visual assets from other open source repos, the source re
633633
## Using new vscode APIs
634634

635635
The minimum required vscode version specified in [package.json](https://github.com/aws/aws-toolkit-vscode/blob/07119655109bb06105a3f53bbcd86b812b32cdbe/package.json#L16)
636-
is decided by the version of vscode running in Cloud9 and other vscode-compatible targets.
636+
is decided by the version of vscode running in other supported vscode-compatible targets (e.g. web).
637637

638638
But you can still use the latest vscode APIs, by checking the current running vscode version. For example, to use a vscode 1.64 API:
639639

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
version: 0.2
2+
3+
phases:
4+
install:
5+
runtime-versions:
6+
nodejs: 16
7+
8+
commands:
9+
- apt update
10+
- apt install -y wget gpg
11+
- curl -sSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
12+
- install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/
13+
- sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'
14+
- apt update
15+
- apt install -y code
16+
17+
pre_build:
18+
commands:
19+
# Check for implicit env vars passed from the release pipeline.
20+
- test -n "${TARGET_EXTENSION}"
21+
22+
build:
23+
commands:
24+
- VERSION=$(node -e "console.log(require('./packages/${TARGET_EXTENSION}/package.json').version);")
25+
# get extension name, if in beta, use some hard-coded recent version
26+
- |
27+
if [ "${TARGET_EXTENSION}" = "amazonq" ]; then
28+
extension_name="amazonwebservices.amazon-q-vscode"
29+
[ "$STAGE" != "prod" ] && VERSION="1.43.0" || true
30+
elif [ "${TARGET_EXTENSION}" = "toolkit" ]; then
31+
extension_name="amazonwebservices.aws-toolkit-vscode"
32+
[ "$STAGE" != "prod" ] && VERSION="3.42.0" || true
33+
else
34+
echo checkmarketplace: "Unknown TARGET_EXTENSION: ${TARGET_EXTENSION}"
35+
exit 1
36+
fi
37+
if [ "$STAGE" != "prod" ]; then
38+
echo "checkmarketplace: Non-production stage detected. Installing hardcoded version '${VERSION}'."
39+
fi
40+
# keep installing the desired extension version until successful. Otherwise fail on codebuild timeout (1 hour).
41+
- |
42+
while true; do
43+
code --uninstall-extension "${extension_name}" --no-sandbox --user-data-dir /tmp/vscode
44+
code --install-extension "${extension_name}@${VERSION}" --no-sandbox --user-data-dir /tmp/vscode || true
45+
cur_version=$(code --list-extensions --show-versions --no-sandbox --user-data-dir /tmp/vscode | grep ${extension_name} | cut -d'@' -f2)
46+
if [ "${cur_version}" = "${VERSION}" ]; then
47+
echo "checkmarketplace: Extension ${extension_name} is updated to version '${cur_version}.'"
48+
break
49+
else
50+
echo "checkmarketplace: Expected extension version '${VERSION}' has not been successfully installed. Retrying..."
51+
fi
52+
sleep 120 # Wait for 2 minutes before retrying
53+
done

cloud9-toolkit-install.sh

Lines changed: 0 additions & 139 deletions
This file was deleted.

docs/CODE_GUIDELINES.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,10 @@ that is a net cost.
8181
- Telemetry: "active" vs "passive"
8282
- Active (`passive:false`) metrics are those intended to appear in DAU count.
8383
- Icons:
84-
- Where possible, use IDE-specific standard icons (e.g. standard VSCode
85-
standard icons in VSCode, and Cloud9 standard icons in Cloud9). The typical
86-
(maintainable) way to do this is to use _named_ icons (what VSCode calls
84+
- Where possible, use standard VSCode icons. The typical (maintainable)
85+
way to do this is to use _named_ icons (what VSCode calls
8786
[codicons](https://microsoft.github.io/vscode-codicons/)) as opposed to
8887
icons shipped with the Toolkit build and referenced by _path_.
89-
- For cases where icons must be statically defined (package.json), if Cloud9
90-
does not support the VSCode standard icon, use the Cloud9 icon.
9188
- Changelog guidelines
9289
- Prefer active voice: "You can do X" instead of "X can be done"
9390
- Avoid unnecessary use of `lodash` (which we may remove in the future).
@@ -240,11 +237,11 @@ _See also [arch_develop.md](./arch_develop.md#exceptions)._
240237
241238
- PREFER:
242239
```ts
243-
things.filter(o => o.isFoo)
240+
things.filter((o) => o.isFoo)
244241
```
245242
- INSTEAD OF:
246243
```ts
247-
things.filter(thing => thing.isFoo)
244+
things.filter((thing) => thing.isFoo)
248245
```
249246
250247
## User settings

docs/arch_runtime.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ If you must define a new key (is it _really_ necessary?), follow these guideline
3131
These keys are currently set by the core/ package, but many of them may eventually be migrated to
3232
toolkit/ or amazonq/ if appropriate.
3333

34-
- `isCloud9`: This is hardcoded by Cloud9 itself, not the Toolkit.
35-
- Cloud9 _does not support setContext_. So this is the only usable key there.
3634
- `aws.codecatalyst.connected`: CodeCatalyst connection is active.
3735
- `aws.codewhisperer.connected`: CodeWhisperer connection is active.
3836
- `aws.codewhisperer.connectionExpired`: CodeWhisperer connection is active, but the connection is expired.

0 commit comments

Comments
 (0)