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

Feature/amazon q /doc: upload diagram files during doc generation #1

Open
wants to merge 33 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
97bd375
fix(amazonq): filter out frequent client error from codegeneration te…
linyuxi-0511 Feb 11, 2025
18590f8
fix(amazonq): enable syntax highlighting when viewing diff for genera…
chungjac Feb 11, 2025
0c88e67
fix(amazonq): Truncating user prompt for unit test generation. (#5359)
laileni-aws Feb 11, 2025
eb19cbc
telemetry(amazonq): refactor doc telemetry to v2 version (#5316)
KevinDing1 Feb 11, 2025
991abe2
fix(amazonq): Q infers source file from active test file for UTG. (#5…
laileni-aws Feb 11, 2025
8c69af2
Updated AuthTelemetry.addConnection telemetry event to Telemetry.auth…
LokeshDogga13 Feb 11, 2025
0761f14
Revert "revert(amazonq): hide java 21 option (#5354)" (#5358)
dhasani23 Feb 11, 2025
f401e08
build: fix 251 build failure from resolving ui-tests-starter dependen…
rli Feb 11, 2025
82cbd6c
build: include 2025.1 in prerelease automation (#5330)
rli Feb 11, 2025
7087f28
Adding gitignore usecase for Test Generation to add more extensions a…
ashishrp-aws Feb 12, 2025
951d519
config(amazonq): customization override should respect users' select…
evanliu048 Feb 12, 2025
b440147
fix(amazonq): fix for /test authentication check (#5355)
ashishrp-aws Feb 12, 2025
c8e4ee4
fix(amazonq): code review navigation not focusing selected issues (#5…
zuoyaofu Feb 12, 2025
68a179a
Revert "feat(amazonq): Prefetch next inline recommendation (#5290)" (…
evanliu048 Feb 13, 2025
39eacec
ci: use single matrix for all prerelease artifacts (#5362)
rli Feb 13, 2025
19931e5
ci: steal commit message linter from VSC toolkit (#5351)
rli Feb 13, 2025
3b6cdc3
Updating version to 3.55
Feb 13, 2025
0972fcc
Updating SNAPSHOT version to 3.56-SNAPSHOT
Feb 13, 2025
3621194
refactor(amazonq): improve error handling of workspace index (#5373)
leigaol Feb 14, 2025
4971993
refactor(Q tech debt): make cwsprClientAdapr stateless and obtain sdk…
Will-ShaoHua Feb 14, 2025
3d9586d
fix(amazonq): only search for sql strings in java files (#5376)
dhasani23 Feb 14, 2025
0625472
fix(telemetry): fix region warning when initializing telemetry with n…
rli Feb 15, 2025
9426764
fix: Fix idea.log path referenced in plugin run configurations (#5369)
rli Feb 15, 2025
fd7eb31
revert(amazonq): pr #5331 broke tests by throwing NotAMock (#5383)
Will-ShaoHua Feb 18, 2025
b72f78b
telemetry(amazonq) add feedback functionality with thumbs up/down (#5…
Randall-Jiang Feb 18, 2025
3ef26d8
build(243): fix build failures from rider failing to resolve test fra…
rli Feb 18, 2025
2eca5a7
telemetry(amazonq): Aligning telemetry strings in VSC and JB. (#5382)
laileni-aws Feb 18, 2025
666798a
fix(amazonq): update logic for converting gitignore pattern to regex …
gandhi-21 Feb 18, 2025
f5460c7
log(amazonq): update log string when workspace process is not spinned…
Will-ShaoHua Feb 18, 2025
e9c40fa
fix(amazonq): fix tab acceptAction not working in JB remote (#5379)
andrewyuq Feb 18, 2025
93b3b5a
fix(amazonq): /doc add suppoort for uploading architecture diagrams (…
vikshe Feb 18, 2025
f0911c4
Adding more extensions and no extension files to test generation usec…
ashishrp-aws Feb 19, 2025
beabdf1
config(amazonq): update polling config for codefix (#5390)
ctlai95 Feb 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .changes/3.55.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"date" : "2025-02-13",
"version" : "3.55",
"entries" : [ {
"type" : "feature",
"description" : "/transform: support transformations to Java 21"
}, {
"type" : "bugfix",
"description" : "Enable syntax highlighting when viewing diff for /test"
}, {
"type" : "bugfix",
"description" : "Amazon Q /test: Truncating user input to 4096 characters for unit test generation."
}, {
"type" : "bugfix",
"description" : "Amazon Q /review: Unable to navigate to code location when selecting issues"
}, {
"type" : "bugfix",
"description" : "Amazon Q /test: Q identify active test file and infer source file for test generation."
}, {
"type" : "removal",
"description" : "Amazon Q: Revert prefetch logic to enable more stable inline completion."
} ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type" : "feature",
"description" : "Amazon Q /doc: support making changes to architecture diagrams"
}
28 changes: 28 additions & 0 deletions .github/workflows/lint-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
on:
push:
branches: [main]
pull_request:
# By default, CI will trigger on opened/synchronize/reopened event types.
# https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#pull_request
# Note: To re-run `lint-commits` after fixing the PR title, close-and-reopen the PR.
branches: [main, feature/*]

# Cancel old jobs when a pull request is updated.
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
lint-commits:
# Note: To re-run `lint-commits` after fixing the PR title, close-and-reopen the PR.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Check PR title
run: |
node "$GITHUB_WORKSPACE/.github/workflows/lintcommit.js"
213 changes: 213 additions & 0 deletions .github/workflows/lintcommit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,213 @@
// Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

// Checks that a PR title conforms to our custom flavor of "conventional commits"
// (https://www.conventionalcommits.org/).
//
// To run self-tests, simply run this script:
//
// node lintcommit.js test
//
// TODO: "PR must describe Problem in a concise way, and Solution".
// TODO: this script intentionally avoids github APIs so that it is locally-debuggable, but if those
// are needed, use actions/github-script as described in: https://github.com/actions/github-script?tab=readme-ov-file#run-a-separate-file
//

const fs = require('fs')
// This script intentionally avoids github APIs so that:
// 1. it is locally-debuggable
// 2. the CI job is fast ("npm install" is slow)
// But if we still want to use github API, we can keep it fast by using `actions/github-script` as
// described in: https://github.com/actions/github-script?tab=readme-ov-file#run-a-separate-file
//
// const core = require('@actions/core')
// const github = require('@actions/github')

const types = new Set([
'build',
// Don't allow "chore" because it's over-used.
// Instead, add a new type if absolutely needed (if the existing ones can't possibly apply).
// 'chore',
'ci',
'config',
'deps',
'docs',
'feat',
'fix',
'perf',
'refactor',
'revert',
'style',
'telemetry',
'test',
'types',
])

// TODO: Validate against this once we are satisfied with this list.
const scopes = new Set([
'amazonq',
'core',
'explorer',
'lambda',
'logs',
'redshift',
'q-chat',
'q-featuredev',
'q-inlinechat',
'q-transform',
'sam',
's3',
'telemetry',
'toolkit',
'ui',
])
void scopes

/**
* Checks that a pull request title, or commit message subject, follows the expected format:
*
* type(scope): message
*
* Returns undefined if `title` is valid, else an error message.
*/
function validateTitle(title) {
const parts = title.split(':')
const subject = parts.slice(1).join(':').trim()

if (title.startsWith('Merge')) {
return undefined
}

if (parts.length < 2) {
return 'missing colon (:) char'
}

const typeScope = parts[0]

const [type, scope] = typeScope.split(/\(([^)]+)\)$/)

if (/\s+/.test(type)) {
return `type contains whitespace: "${type}"`
} else if (type === 'chore') {
return 'Do not use "chore" as a type. If the existing valid types are insufficent, add a new type to the `lintcommit.js` script.'
} else if (!types.has(type)) {
return `invalid type "${type}"`
} else if (!scope && typeScope.includes('(')) {
return `must be formatted like type(scope):`
} else if (!scope && ['feat', 'fix'].includes(type)) {
return `"${type}" type must include a scope (example: "${type}(amazonq)")`
} else if (scope && scope.length > 30) {
return 'invalid scope (must be <=30 chars)'
} else if (scope && /[^- a-z0-9]+/.test(scope)) {
return `invalid scope (must be lowercase, ascii only): "${scope}"`
} else if (subject.length === 0) {
return 'empty subject'
} else if (subject.length > 100) {
return 'invalid subject (must be <=100 chars)'
}

return undefined
}

function run() {
const eventData = JSON.parse(fs.readFileSync(process.env.GITHUB_EVENT_PATH, 'utf8'))
const pullRequest = eventData.pull_request

// console.log(eventData)

if (!pullRequest) {
console.info('No pull request found in the context')
return
}

const title = pullRequest.title

const failReason = validateTitle(title)
const msg = failReason
? `
Invalid pull request title: \`${title}\`

* Problem: ${failReason}
* Expected format: \`type(scope): subject...\`
* type: one of (${Array.from(types).join(', ')})
* scope: lowercase, <30 chars
* subject: must be <100 chars
* documentation: https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#pull-request-title
* Hint: *close and re-open the PR* to re-trigger CI (after fixing the PR title).
`
: `Pull request title matches the [expected format](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#pull-request-title).`

if (process.env.GITHUB_STEP_SUMMARY) {
fs.appendFileSync(process.env.GITHUB_STEP_SUMMARY, msg)
}

if (failReason) {
console.error(msg)
process.exit(1)
} else {
console.info(msg)
}
}

function _test() {
const tests = {
' foo(scope): bar': 'type contains whitespace: " foo"',
'build: update build process': undefined,
'chore: update dependencies':
'Do not use "chore" as a type. If the existing valid types are insufficent, add a new type to the `lintcommit.js` script.',
'ci: configure CI/CD': undefined,
'config: update configuration files': undefined,
'deps: bump the aws-sdk group across 1 directory with 5 updates': undefined,
'docs: update documentation': undefined,
'feat(foo): add new feature': undefined,
'feat(foo):': 'empty subject',
'feat foo):': 'type contains whitespace: "feat foo)"',
'feat(foo)): sujet': 'invalid type "feat(foo))"',
'feat(foo: sujet': 'invalid type "feat(foo"',
'feat(Q Foo Bar): bar': 'invalid scope (must be lowercase, ascii only): "Q Foo Bar"',
'feat(scope):': 'empty subject',
'feat(q foo bar): bar': undefined,
'feat(foo): x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x ':
'invalid subject (must be <=100 chars)',
'feat: foo': '"feat" type must include a scope (example: "feat(amazonq)")',
'fix: foo': '"fix" type must include a scope (example: "fix(amazonq)")',
'fix(a-b-c): resolve issue': undefined,
'foo (scope): bar': 'type contains whitespace: "foo "',
'invalid title': 'missing colon (:) char',
'perf: optimize performance': undefined,
'refactor: improve code structure': undefined,
'revert: feat: add new feature': undefined,
'style: format code': undefined,
'test: add new tests': undefined,
'types: add type definitions': undefined,
'Merge staging into feature/lambda-get-started': undefined,
}

let passed = 0
let failed = 0

for (const [title, expected] of Object.entries(tests)) {
const result = validateTitle(title)
if (result === expected) {
console.log(`✅ Test passed for "${title}"`)
passed++
} else {
console.log(`❌ Test failed for "${title}" (expected "${expected}", got "${result}")`)
failed++
}
}

console.log(`\n${passed} tests passed, ${failed} tests failed`)
}

function main() {
const mode = process.argv[2]

if (mode === 'test') {
_test()
} else {
run()
}
}

main()
85 changes: 14 additions & 71 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ concurrency:
cancel-in-progress: true

jobs:
generate_artifact_toolkit_standalone:
generate_artifact:
strategy:
matrix:
supported_versions: [ '2024.1', '2024.2', '2024.3' ]
build_target: [ ':plugin-core:buildPlugin', ':plugin-toolkit:intellij-standalone:buildPlugin', ':plugin-amazonq:buildPlugin' ]
version: [ '2024.1', '2024.2', '2024.3', '2025.1' ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -38,71 +39,19 @@ jobs:
dotnet-version: '6.x'
- name: Generate artifact
run: |
./gradlew -PideProfileName=${{ matrix.supported_versions }} :plugin-toolkit:intellij-standalone:buildPlugin
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: plugin-standalone-${{ matrix.supported_versions }}
path: ./plugins/toolkit/intellij-standalone/build/distributions/*.zip
retention-days: 1

generate_artifact_q:
strategy:
matrix:
supported_versions: [ '2024.1', '2024.2', '2024.3' ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: remove unwanted dependencies
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '21'
- name: Generate artifact
run: |
./gradlew -PideProfileName=${{ matrix.supported_versions }} :plugin-amazonq:buildPlugin
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: plugin-amazonq-${{ matrix.supported_versions }}
path: ./plugins/amazonq/build/distributions/*.zip
retention-days: 1

generate_artifact_core:
strategy:
matrix:
supported_versions: [ '2024.1', '2024.2', '2024.3' ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: remove unwanted dependencies
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '21'

- name: Generate artifact
./gradlew -PideProfileName=${{ matrix.version }} ${{ matrix.build_target }}
- name: Fix artifact name
env:
BUILD_TARGET: "${{ matrix.build_target }}"
ARTIFACT_NAME: "${{ matrix.build_target }}-${{ matrix.version }}"
run: |
./gradlew -PideProfileName=${{ matrix.supported_versions }} :plugin-core:buildPlugin
echo "ARTIFACT_SUBPATH=$(echo $BUILD_TARGET | sed -e 's/^:plugin-//' -e 's/:buildPlugin$//' -e 's/:/\//')" >> $GITHUB_ENV
echo "ARTIFACT_NAME=${ARTIFACT_NAME//:}" >> $GITHUB_ENV
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: plugin-core-${{ matrix.supported_versions }}
path: ./plugins/core/build/distributions/*.zip
name: ${{ env.ARTIFACT_NAME }}
path: ./plugins/${{ env.ARTIFACT_SUBPATH }}/build/distributions/*.zip
retention-days: 1

generate_changelog:
Expand Down Expand Up @@ -148,7 +97,7 @@ jobs:
echo 'EOF' >> $GITHUB_OUTPUT

publish:
needs: [ generate_artifact_toolkit_standalone, generate_artifact_core, generate_artifact_q, generate_changelog ]
needs: [ generate_artifact, generate_changelog ]
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
Expand All @@ -172,13 +121,7 @@ jobs:
- name: Publish to GitHub Releases
run: |
envsubst < "$GITHUB_WORKSPACE/.github/workflows/prerelease_notes.md" > "$RUNNER_TEMP/prerelease_notes.md"
gh release create "$TAG_NAME" --prerelease --notes-file "$RUNNER_TEMP/prerelease_notes.md" --title "$SUBJECT" --target $GITHUB_SHA plugin-standalone-*/*.zip
- name: Publish core
run: |
gh release upload "$TAG_NAME" plugin-core-*/*.zip
- name: Publish Q
run: |
gh release upload "$TAG_NAME" plugin-amazonq-*/*.zip
gh release create "$TAG_NAME" --prerelease --notes-file "$RUNNER_TEMP/prerelease_notes.md" --title "$SUBJECT" --target $GITHUB_SHA plugin*/*.zip
- name: Publish XML manifest
run: |
gh release view "$TAG_NAME" --repo "$GITHUB_REPOSITORY" --json assets | python3 "$GITHUB_WORKSPACE/.github/workflows/generateUpdatesXml.py" - > updatePlugins.xml
Expand Down
Loading
Loading