diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 2b9f266d5..a005cffd7 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -4,6 +4,7 @@ ## Checklist +- [] I've read the [contributing guide](https://github.com/continuedev/continue/blob/main/CONTRIBUTING.md) - [] The relevant docs, if any, have been updated or created - [] The relevant tests, if any, have been updated or created diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index 5985624de..43d65d5b5 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -1,6 +1,9 @@ name: Create Automatic Release on: + push: + branches: + - nate/auto-main-release-draft schedule: - cron: "0 17 * * 1,3,5" # Run at 9am PST (17:00 UTC) on Monday, Wednesday, Friday workflow_dispatch: # Keep manual trigger option @@ -13,30 +16,13 @@ jobs: steps: - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Important for getting all tags and commits - - name: Get latest tag - id: get_latest_tag + - name: Get version from package.json + id: get_version run: | - # Get the latest tag ending in -vscode or default to v1.1.0-vscode if none exists - latest_tag=$(git tag --sort=-creatordate | grep -E "-vscode$" | head -n 1 || echo "v1.1.0-vscode") - echo "Latest tag: $latest_tag" - echo "LATEST_TAG=$latest_tag" >> $GITHUB_ENV - - - name: Generate next version - id: generate_version - run: | - # Extract version numbers (handle the -vscode suffix) - version=${LATEST_TAG#v} # Remove v prefix - version=${version%-vscode} # Remove -vscode suffix - IFS='.' read -ra VERSION_PARTS <<< "$version" - - # Increment patch version - ((VERSION_PARTS[2]++)) - - # Create new version string with -vscode suffix - new_version="v${VERSION_PARTS[0]}.${VERSION_PARTS[1]}.${VERSION_PARTS[2]}-vscode" + # Read version from package.json and add -vscode suffix + version=$(node -p "require('./extensions/vscode/package.json').version") + new_version="v${version}-vscode" echo "New version will be: $new_version" echo "NEW_VERSION=$new_version" >> $GITHUB_ENV @@ -49,7 +35,7 @@ jobs: --generate-notes \ --title "$NEW_VERSION" \ --draft \ - --latest + --latest \ --prerelease create-jetbrains-release: @@ -60,29 +46,14 @@ jobs: steps: - uses: actions/checkout@v4 with: - fetch-depth: 0 # Important for getting all tags and commits + fetch-depth: 0 - - name: Get latest tag - id: get_latest_tag + - name: Get version from gradle.properties + id: get_version run: | - # Get the latest tag ending in -jetbrains or default to v1.1.0-jetbrains if none exists - latest_tag=$(git tag --sort=-creatordate | grep -E "-jetbrains$" | head -n 1 || echo "v1.1.0-jetbrains") - echo "Latest tag: $latest_tag" - echo "LATEST_TAG=$latest_tag" >> $GITHUB_ENV - - - name: Generate next version - id: generate_version - run: | - # Extract version numbers (handle the -jetbrains suffix) - version=${LATEST_TAG#v} # Remove v prefix - version=${version%-jetbrains} # Remove -jetbrains suffix - IFS='.' read -ra VERSION_PARTS <<< "$version" - - # Increment patch version - ((VERSION_PARTS[2]++)) - - # Create new version string with -jetbrains suffix - new_version="v${VERSION_PARTS[0]}.${VERSION_PARTS[1]}.${VERSION_PARTS[2]}-jetbrains" + # Read version from gradle.properties and add -jetbrains suffix + version=$(grep '^pluginVersion=' extensions/intellij/gradle.properties | cut -d'=' -f2) + new_version="v${version}-jetbrains" echo "New version will be: $new_version" echo "NEW_VERSION=$new_version" >> $GITHUB_ENV @@ -95,5 +66,5 @@ jobs: --generate-notes \ --title "$NEW_VERSION" \ --draft \ - --latest + --latest \ --prerelease diff --git a/.github/workflows/jetbrains-release.yaml b/.github/workflows/jetbrains-release.yaml index a968dcc19..629fa97b7 100644 --- a/.github/workflows/jetbrains-release.yaml +++ b/.github/workflows/jetbrains-release.yaml @@ -37,6 +37,52 @@ jobs: echo "should_run=false" >> $GITHUB_OUTPUT fi + bump-version: + runs-on: ubuntu-latest + needs: + - check_release_name + if: github.event_name != 'workflow_dispatch' || github.event.inputs.publish_build == 'true' + permissions: + contents: write + pull-requests: write + steps: + # 0. Setup git + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Git + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + + - name: Create PR branch + run: | + BRANCH_NAME="chore/bump-jetbrains-version-$(date +%Y%m%d-%H%M%S)" + git checkout -b $BRANCH_NAME + echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV + + - name: Bump version in gradle.properties + run: | + cd extensions/intelllij + awk '/pluginVersion=/{split($0,a,"="); split(a[2],b,"."); b[3]+=1; printf "%s=%s.%s.%s\n",a[1],b[1],b[2],b[3];next}1' gradle.properties > tmp && mv tmp gradle.properties + rm -rf tmp + NEW_VERSION=$(grep 'pluginVersion=' gradle.properties | cut -d'=' -f2) + echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v7 + with: + token: ${{ secrets.CI_GITHUB_TOKEN }} + commit-message: "chore: bump jetbrains extension version to ${{ env.NEW_VERSION }}" + title: "chore: bump jetbrains extension version to ${{ env.NEW_VERSION }}" + body: | + Automated PR to bump the JetBrains extension version after successful pre-release publication. + + - Bumped version in extensions/intellij/gradle.properties to ${{ env.NEW_VERSION }} + branch: ${{ env.BRANCH_NAME }} + base: main + delete-branch: true + # Prepare and publish the plugin to JetBrains Marketplace repository build: needs: check_release_name @@ -121,6 +167,21 @@ jobs: path: gui/node_modules key: ${{ runner.os }}-node-${{ hashFiles('gui/package-lock.json') }} + - uses: actions/cache@v4 + id: config-yaml-cache + with: + path: packages/config-yaml/node_modules + key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }} + + - name: Build and check config-yaml + run: | + cd ../../packages/config-yaml + npm i + npx tsc --noEmit + # Tests are currently failing, commenting out for now + # npm test + npm run build + # npm install core - name: Install core node_modules run: | diff --git a/.github/workflows/pr_checks.yaml b/.github/workflows/pr_checks.yaml index bf8ce2ecb..c490373a0 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -1,15 +1,14 @@ name: PR checks +# PR Checks run on all PRs to the main branch and must pass before merging. on: pull_request: branches: - main - - staging push: branches: - main - - staging jobs: install-root: @@ -31,6 +30,62 @@ jobs: if: steps.root-cache.outputs.cache-hit != 'true' run: npm ci + install-config-yaml: + needs: install-root + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version-file: ".nvmrc" + + - uses: actions/cache@v4 + with: + path: node_modules + key: ${{ runner.os }}-root-node-modules-${{ hashFiles('package-lock.json') }} + + - uses: actions/cache@v4 + id: config-yaml-cache + with: + path: packages/config-yaml/node_modules + key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }} + + - name: Install config-yaml dependencies + if: steps.config-yaml-cache.outputs.cache-hit != 'true' + run: | + cd packages/config-yaml + npm ci + + config-yaml-checks: + needs: install-config-yaml + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version-file: ".nvmrc" + + - uses: actions/cache@v4 + with: + path: node_modules + key: ${{ runner.os }}-root-node-modules-${{ hashFiles('package-lock.json') }} + + - uses: actions/cache@v4 + id: config-yaml-cache + with: + path: packages/config-yaml/node_modules + key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }} + + - name: Build and check config-yaml + run: | + cd packages/config-yaml + npx tsc --noEmit + # Tests are currently failing, commenting out for now + # npm test + npm run build + install-core: needs: install-root runs-on: ubuntu-latest @@ -60,7 +115,7 @@ jobs: npm ci core-checks: - needs: install-core + needs: [install-core, install-config-yaml] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -81,6 +136,17 @@ jobs: path: core/node_modules key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }} + - uses: actions/cache@v4 + id: config-yaml-cache + with: + path: packages/config-yaml/node_modules + key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }} + + - name: Build config-yaml + run: | + cd packages/config-yaml + npm run build + - name: Type check and lint run: | cd core @@ -90,7 +156,7 @@ jobs: OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} install-gui: - needs: [install-root, install-core] + needs: [install-root, install-core, install-config-yaml] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -115,6 +181,17 @@ jobs: path: gui/node_modules key: ${{ runner.os }}-gui-node-modules-${{ hashFiles('gui/package-lock.json') }} + - uses: actions/cache@v4 + id: config-yaml-cache + with: + path: packages/config-yaml/node_modules + key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }} + + - name: Build config-yaml + run: | + cd packages/config-yaml + npm run build + - name: Install gui dependencies if: steps.gui-cache.outputs.cache-hit != 'true' run: | @@ -147,13 +224,24 @@ jobs: path: gui/node_modules key: ${{ runner.os }}-gui-node-modules-${{ hashFiles('gui/package-lock.json') }} + - uses: actions/cache@v4 + id: config-yaml-cache + with: + path: packages/config-yaml/node_modules + key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }} + + - name: Build config-yaml + run: | + cd packages/config-yaml + npm run build + - name: Type check run: | cd gui npx tsc --noEmit binary-checks: - needs: [install-root, install-core] + needs: [install-root, install-core, install-config-yaml] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -178,6 +266,17 @@ jobs: path: binary/node_modules key: ${{ runner.os }}-binary-node-modules-${{ hashFiles('binary/package-lock.json') }} + - uses: actions/cache@v4 + id: config-yaml-cache + with: + path: packages/config-yaml/node_modules + key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }} + + - name: Build config-yaml + run: | + cd packages/config-yaml + npm run build + - name: Install binary dependencies if: steps.binary-cache.outputs.cache-hit != 'true' run: | @@ -190,7 +289,7 @@ jobs: npx tsc --noEmit install-vscode: - needs: [install-root, install-core] + needs: [install-root, install-core, install-config-yaml] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -215,6 +314,17 @@ jobs: path: extensions/vscode/node_modules key: ${{ runner.os }}-vscode-node-modules-${{ hashFiles('extensions/vscode/package-lock.json') }} + - uses: actions/cache@v4 + id: config-yaml-cache + with: + path: packages/config-yaml/node_modules + key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }} + + - name: Build config-yaml + run: | + cd packages/config-yaml + npm run build + - name: Install vscode dependencies if: steps.vscode-cache.outputs.cache-hit != 'true' run: | @@ -249,14 +359,26 @@ jobs: path: extensions/vscode/node_modules key: ${{ runner.os }}-vscode-node-modules-${{ hashFiles('extensions/vscode/package-lock.json') }} + - uses: actions/cache@v4 + id: config-yaml-cache + with: + path: packages/config-yaml/node_modules + key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }} + + - name: Build config-yaml + run: | + cd packages/config-yaml + npm run build + - name: Type check and lint run: | cd extensions/vscode + npm run write-build-timestamp npx tsc --noEmit npm run lint core-tests: - needs: install-core + needs: [install-core, install-config-yaml] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -270,6 +392,17 @@ jobs: path: core/node_modules key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }} + - uses: actions/cache@v4 + id: config-yaml-cache + with: + path: packages/config-yaml/node_modules + key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }} + + - name: Build config-yaml + run: | + cd packages/config-yaml + npm run build + - name: Run core tests run: | cd core @@ -283,9 +416,33 @@ jobs: AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }} AZURE_FOUNDRY_API_KEY: ${{ secrets.AZURE_FOUNDRY_API_KEY }} + package-tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version-file: ".nvmrc" + + - uses: actions/cache@v4 + with: + path: core/node_modules + key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }} + + - name: Install dependencies + run: | + cd packages/config-yaml + npm ci + + - name: Run config-yaml tests + run: | + cd packages/config-yaml + npm test + vscode-get-test-file-matrix: runs-on: ubuntu-latest - needs: [install-root, install-vscode] + needs: [install-root, install-vscode, install-config-yaml] outputs: test_file_matrix: ${{ steps.vscode-get-test-file-matrix.outputs.test_file_matrix }} steps: @@ -297,6 +454,17 @@ jobs: path: extensions/vscode/node_modules key: ${{ runner.os }}-vscode-node-modules-${{ hashFiles('extensions/vscode/package-lock.json') }} + - uses: actions/cache@v4 + id: config-yaml-cache + with: + path: packages/config-yaml/node_modules + key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }} + + - name: Build config-yaml + run: | + cd packages/config-yaml + npm run build + - name: Get test files id: vscode-get-test-file-matrix run: | @@ -320,7 +488,7 @@ jobs: vscode-package-extension: runs-on: ubuntu-latest - needs: [install-vscode, install-core] + needs: [install-vscode, install-core, install-config-yaml] steps: - uses: actions/checkout@v4 @@ -340,6 +508,17 @@ jobs: path: core/node_modules key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }} + - uses: actions/cache@v4 + id: config-yaml-cache + with: + path: packages/config-yaml/node_modules + key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }} + + - name: Build config-yaml + run: | + cd packages/config-yaml + npm run build + - name: Package extension run: | cd extensions/vscode @@ -353,7 +532,7 @@ jobs: vscode-download-e2e-dependencies: runs-on: ubuntu-latest - needs: [install-vscode, install-core] + needs: [install-vscode, install-core, install-config-yaml] steps: - uses: actions/checkout@v4 @@ -373,6 +552,17 @@ jobs: path: extensions/vscode/e2e/storage key: ${{ runner.os }}-vscode-storage-${{ hashFiles('extensions/vscode/package-lock.json') }} + - uses: actions/cache@v4 + id: config-yaml-cache + with: + path: packages/config-yaml/node_modules + key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }} + + - name: Build config-yaml + run: | + cd packages/config-yaml + npm run build + - name: Download Dependencies if: steps.storage-cache.outputs.cache-hit != 'true' run: | @@ -386,7 +576,7 @@ jobs: path: extensions/vscode/e2e/storage vscode-e2e-tests: - name: ${{ matrix.test_file }} (${{ matrix.command }}) + name: ${{ matrix.test_file || 'unknown' }} (${{ matrix.command }}) needs: [ vscode-download-e2e-dependencies, @@ -394,6 +584,7 @@ jobs: vscode-package-extension, install-vscode, install-core, + install-config-yaml, ] runs-on: ubuntu-latest # Tests requiring secrets need approval from maintainers @@ -434,6 +625,17 @@ jobs: name: vscode-e2e-dependencies path: extensions/vscode/e2e/storage + - uses: actions/cache@v4 + id: config-yaml-cache + with: + path: packages/config-yaml/node_modules + key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }} + + - name: Build config-yaml + run: | + cd packages/config-yaml + npm run build + - name: Fix VSCode binary permissions run: | chmod +x extensions/vscode/e2e/storage/VSCode-linux-x64/code @@ -475,8 +677,29 @@ jobs: name: e2e-failure-screenshots path: extensions/vscode/e2e/storage/screenshots + - name: Sanitize test file name + id: sanitize_filename + if: always() + run: | + FILENAME="${{ matrix.test_file }}" + SANITIZED_FILENAME="${FILENAME//\//-}" # Replace / with - using bash parameter expansion + echo "sanitized_test_file=${SANITIZED_FILENAME}" >> $GITHUB_OUTPUT + + - name: Find e2e log file + if: always() + run: | + echo "Searching for e2e.log file..." + find $GITHUB_WORKSPACE -name "e2e.log" -type f + + - name: Upload e2e logs + if: always() + uses: actions/upload-artifact@v4 + with: + name: e2e-logs-${{ steps.sanitize_filename.outputs.sanitized_test_file || 'unknown' }}-${{ matrix.command == 'e2e:ci:run-yaml' && 'yaml' || 'json' }} + path: extensions/vscode/e2e.log + gui-tests: - needs: [install-gui, install-core] + needs: [install-gui, install-core, install-config-yaml] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -496,6 +719,17 @@ jobs: path: core/node_modules key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }} + - uses: actions/cache@v4 + id: config-yaml-cache + with: + path: packages/config-yaml/node_modules + key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }} + + - name: Build config-yaml + run: | + cd packages/config-yaml + npm run build + - name: Install GUI dependencies if: steps.gui-cache.outputs.cache-hit != 'true' run: cd gui && npm ci @@ -508,7 +742,7 @@ jobs: npm test jetbrains-tests: - needs: [install-root, core-checks] + needs: [install-root, core-checks, install-config-yaml] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -517,6 +751,17 @@ jobs: path: core/node_modules key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }} + - uses: actions/cache@v4 + id: config-yaml-cache + with: + path: packages/config-yaml/node_modules + key: ${{ runner.os }}-config-yaml-node-modules-${{ hashFiles('packages/config-yaml/package-lock.json') }} + + - name: Build config-yaml + run: | + cd packages/config-yaml + npm run build + - name: Setup Java uses: actions/setup-java@v4.5.0 with: @@ -621,17 +866,18 @@ jobs: - install-vscode - vscode-checks - core-tests + - package-tests - vscode-get-test-file-matrix - vscode-package-extension - vscode-download-e2e-dependencies - vscode-e2e-tests - gui-tests - jetbrains-tests + - config-yaml-checks + - install-config-yaml steps: - name: Decide whether the needed jobs succeeded or failed uses: re-actors/alls-green@release/v1 with: - allowed-failures: - allowed-skips: jobs: ${{ toJSON(needs) }} diff --git a/.github/workflows/preview.yaml b/.github/workflows/preview.yaml index 80eaa4931..23ea26bf6 100644 --- a/.github/workflows/preview.yaml +++ b/.github/workflows/preview.yaml @@ -263,7 +263,7 @@ jobs: echo "NEW_VERSION=$VERSION" >> $GITHUB_ENV - name: Create Pull Request - uses: peter-evans/create-pull-request@v5 + uses: peter-evans/create-pull-request@v7 with: token: ${{ secrets.CI_GITHUB_TOKEN }} commit-message: "chore: bump vscode extension version to ${{ env.NEW_VERSION }}" diff --git a/.github/workflows/vscode-version-bump.yml b/.github/workflows/vscode-version-bump.yml index 39dc5b7f1..c05da185f 100644 --- a/.github/workflows/vscode-version-bump.yml +++ b/.github/workflows/vscode-version-bump.yml @@ -1,4 +1,4 @@ -name: VS Code Extension Version Bump +name: Create VS Code main release draft on: schedule: # Runs at 7 AM PST (15:00 UTC) every Friday @@ -15,6 +15,10 @@ jobs: with: fetch-depth: 0 # Fetch all history and tags + - name: Setup GitHub CLI + run: | + gh auth login --with-token <<< "${{ github.token }}" + - name: Use Node.js from .nvmrc uses: actions/setup-node@v4 with: @@ -97,6 +101,15 @@ jobs: echo "Pushing branch to origin..." git push origin $NEW_BRANCH + # Add release creation + echo "Creating draft release..." + gh release create "${NEW_BRANCH}" \ + --title "${NEW_BRANCH}" \ + --generate-notes \ + --draft \ + --latest \ + --notes-start-tag "${LAST_1_0_TAG}" + echo "Version bump process completed successfully!" - name: Check for errors diff --git a/.gitignore b/.gitignore index 92cb4b852..2ca914069 100644 --- a/.gitignore +++ b/.gitignore @@ -83,16 +83,6 @@ ipython_config.py # pyenv .python-version -# pipenv -# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. -# However, in case of collaboration, if having platform-specific dependencies or dependencies -# having no cross-platform support, pipenv may install dependencies that don't work, or not -# install all needed dependencies. -#Pipfile.lock - -# PEP 582; used by e.g. github.com/David-OConnor/pyflow -__pypackages__/ - # Celery stuff celerybeat-schedule celerybeat.pid diff --git a/.idea/compiler.xml b/.idea/compiler.xml index b589d56e9..2a7499c2b 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -3,4 +3,7 @@ + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 1d937028b..c277e816e 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -5,6 +5,7 @@