diff --git a/.changes/3.51.json b/.changes/3.51.json new file mode 100644 index 00000000000..5c7a292d3f5 --- /dev/null +++ b/.changes/3.51.json @@ -0,0 +1,29 @@ +{ + "date" : "2025-01-29", + "version" : "3.51", + "entries" : [ { + "type" : "feature", + "description" : "Amazon Q: Now the Amazon Q suggestions can co-exist with Jetbrains suggestions, with tab behavior configurable in the settings." + }, { + "type" : "feature", + "description" : "Amazon Q: Amazon Q inline now has configurable shortcuts for various actions including accept and browsing through suggestions." + }, { + "type" : "feature", + "description" : "Add setting to allow Q /dev to run code and test commands" + }, { + "type" : "feature", + "description" : "Amazon Q: The suggestion popup will hide by default and will be displayed when the suggestion is being hovered over." + }, { + "type" : "bugfix", + "description" : "Amazon Q /doc: fix open diff in a tab when another modal is open" + }, { + "type" : "bugfix", + "description" : "Amazon Q /test: Fixed an issue which incorrectly caused payload size exceeded exception when collecting project payload files" + }, { + "type" : "bugfix", + "description" : "fix(amazonq): For security reasons, disabled auto linkify for link texts coming in markdown other than [TEXT](URL) format" + }, { + "type" : "bugfix", + "description" : "Fix UI freeze caused by updating workspace index on non background context" + } ] +} \ No newline at end of file diff --git a/.changes/3.52.json b/.changes/3.52.json new file mode 100644 index 00000000000..3a7d31690a4 --- /dev/null +++ b/.changes/3.52.json @@ -0,0 +1,23 @@ +{ + "date" : "2025-02-06", + "version" : "3.52", + "entries" : [ { + "type" : "feature", + "description" : "Adds event listener for notifying UI that AB feature configurations have been resolved" + }, { + "type" : "feature", + "description" : "Amazon Q /review: Code issues can now be grouped by severity or file location." + }, { + "type" : "feature", + "description" : "Inline suggestions: Pre-fetch recommendations to reduce suggestion latency." + }, { + "type" : "bugfix", + "description" : "fix(amazonq): Citation links are not clickable as numbers, but appear as non-clickable texts" + }, { + "type" : "bugfix", + "description" : "Amazon Q: Prevent IndexOutOfBoundsException by adding boundary checks for invalid range markers (#5187)" + }, { + "type" : "bugfix", + "description" : "/test placeholder text aligned across IDEs" + } ] +} \ No newline at end of file diff --git a/.changes/3.53.json b/.changes/3.53.json new file mode 100644 index 00000000000..0bcc69e9ca2 --- /dev/null +++ b/.changes/3.53.json @@ -0,0 +1,8 @@ +{ + "date" : "2025-02-07", + "version" : "3.53", + "entries" : [ { + "type" : "bugfix", + "description" : "Amazon Q: Fixed an issue where in a specific scenario when receiving multiple suggestions with JetBrains suggestions visible, users are not able to accept the suggestion." + } ] +} \ No newline at end of file diff --git a/.changes/3.54.json b/.changes/3.54.json new file mode 100644 index 00000000000..bf267eb0c62 --- /dev/null +++ b/.changes/3.54.json @@ -0,0 +1,8 @@ +{ + "date" : "2025-02-11", + "version" : "3.54", + "entries" : [ { + "type" : "bugfix", + "description" : "Amazon Q: Reverting the behavior of making JetBrains suggestions(IntelliSense) and Q suggestions co-exist" + } ] +} \ No newline at end of file diff --git a/.changes/3.55.json b/.changes/3.55.json new file mode 100644 index 00000000000..6d4e03b6a52 --- /dev/null +++ b/.changes/3.55.json @@ -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." + } ] +} \ No newline at end of file diff --git a/.changes/3.56.json b/.changes/3.56.json new file mode 100644 index 00000000000..06cd38b6e08 --- /dev/null +++ b/.changes/3.56.json @@ -0,0 +1,8 @@ +{ + "date" : "2025-02-20", + "version" : "3.56", + "entries" : [ { + "type" : "feature", + "description" : "Amazon Q /doc: support making changes to architecture diagrams" + } ] +} \ No newline at end of file diff --git a/.github/workflows/lint-commit.yml b/.github/workflows/lint-commit.yml new file mode 100644 index 00000000000..210a08a771e --- /dev/null +++ b/.github/workflows/lint-commit.yml @@ -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" diff --git a/.github/workflows/lintcommit.js b/.github/workflows/lintcommit.js new file mode 100644 index 00000000000..299657f0a1c --- /dev/null +++ b/.github/workflows/lintcommit.js @@ -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() diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 4e5d0a67b2f..7747ca912ff 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -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 @@ -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: @@ -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 }} @@ -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 diff --git a/.run/Run AWS Toolkit - Community [2024.1].run.xml b/.run/Run AWS Toolkit - Community [2024.1].run.xml index 13b3332cbbd..3d66c9885ff 100644 --- a/.run/Run AWS Toolkit - Community [2024.1].run.xml +++ b/.run/Run AWS Toolkit - Community [2024.1].run.xml @@ -1,6 +1,6 @@ - +