From 26ba1b57ccbcb1bd3f042e8c5c5e6e2fff51ac74 Mon Sep 17 00:00:00 2001 From: MarkoBosnjak98 Date: Fri, 16 May 2025 11:40:36 +0200 Subject: [PATCH 1/5] Add cloud staging build to main --- .github/workflows/cloud-staging-build.yaml | 184 +++++++++++++++++++++ 1 file changed, 184 insertions(+) create mode 100644 .github/workflows/cloud-staging-build.yaml diff --git a/.github/workflows/cloud-staging-build.yaml b/.github/workflows/cloud-staging-build.yaml new file mode 100644 index 0000000000..f237f06d31 --- /dev/null +++ b/.github/workflows/cloud-staging-build.yaml @@ -0,0 +1,184 @@ +name: Staging Cloud Build and Deploy + +on: + workflow_dispatch: + inputs: + extension_commit_sha: + description: "Extension commit SHA (defaults to latest commit on selected branch)" + required: false + type: string + default: "" + extension_branch: + description: "Extension branch to use" + required: false + type: string + default: "main" + core_commit_sha: + description: "Core commit SHA (defaults to latest commit on selected branch)" + required: false + type: string + default: "" + core_branch: + description: "Core branch to use" + required: false + type: string + default: "main" + +permissions: + contents: write + +jobs: + get-versions: + runs-on: ubuntu-latest + outputs: + extension_sha: ${{ steps.get-extension-sha.outputs.extension_sha }} + core_sha: ${{ steps.get-core-sha.outputs.core_sha }} + combined_tag: ${{ steps.generate-tag.outputs.combined_tag }} + + steps: + - name: Checkout Extension + uses: actions/checkout@v4 + with: + repository: Pythagora-io/gpt-pilot-vs-code-extension + token: ${{ secrets.GH_PAT }} + path: tmp_extension + ref: ${{ inputs.extension_commit_sha || inputs.extension_branch }} + fetch-depth: 0 + + - name: Get extension SHA + id: get-extension-sha + run: | + cd tmp_extension + SHA=$(git rev-parse HEAD) + echo "Extension SHA: $SHA" + echo "extension_sha=$SHA" >> $GITHUB_OUTPUT + cd .. + + + - name: Checkout Core + uses: actions/checkout@v4 + with: + repository: Pythagora-io/pythagora-v1 + token: ${{ secrets.GH_PAT }} + path: tmp_core + ref: ${{ inputs.core_commit_sha || inputs.core_branch }} + fetch-depth: 0 + + - name: Get core SHA + id: get-core-sha + run: | + cd tmp_core + SHA=$(git rev-parse HEAD) + echo "Core SHA: $SHA" + echo "core_sha=$SHA" >> $GITHUB_OUTPUT + cd .. + + - name: Generate combined image tag + id: generate-tag + run: | + EXT_SHORT=$(echo "${{ steps.get-extension-sha.outputs.extension_sha }}" | cut -c1-7) + CORE_SHORT=$(echo "${{ steps.get-core-sha.outputs.core_sha }}" | cut -c1-7) + TAG="ext-${EXT_SHORT}_core-${CORE_SHORT}" + echo "Combined tag: $TAG" + echo "combined_tag=$TAG" >> $GITHUB_OUTPUT + + deploy: + needs: get-versions + runs-on: ubuntu-latest + + steps: + - name: Checkout Extension + uses: actions/checkout@v4 + with: + repository: Pythagora-io/gpt-pilot-vs-code-extension + token: ${{ secrets.GH_PAT }} + path: tmp_extension + ref: ${{ needs.get-versions.outputs.extension_sha }} # Use SHA instead of version + fetch-depth: 0 + + - name: Checkout Core + uses: actions/checkout@v4 + with: + repository: Pythagora-io/pythagora-v1 + token: ${{ secrets.GH_PAT }} + path: tmp_core + ref: ${{ needs.get-versions.outputs.core_sha }} + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Setup extension + run: | + cd tmp_extension + npm install + npm run compile:ts + npm install -g @vscode/vsce + vsce package + cd .. + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v3 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: us-east-1 + + - name: Login to ECR + uses: docker/login-action@v3 + with: + registry: ${{ secrets.ECR_URL }} + username: ${{ vars.AWS_ACCESS_KEY_ID }} + password: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + + - name: Docker build and push + run: | + cd tmp_core + cp ../tmp_extension/*.vsix ./pythagora-vs-code.vsix + docker build --platform=linux/amd64 -f Dockerfile -t ${{ secrets.ECR_URL }}/pythagora/workspace:${{ needs.get-versions.outputs.combined_tag }} . + docker push ${{ secrets.ECR_URL }}/pythagora/workspace:${{ needs.get-versions.outputs.combined_tag }} + cd .. + + - name: Checkout Workspace Helm + uses: actions/checkout@v4 + with: + repository: Pythagora-io/workspace-helm + token: ${{ secrets.GH_PAT }} + path: tmp_wh + ref: 'staging' + fetch-depth: 0 + + - name: Install yq + run: | + wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/local/bin/yq + chmod +x /usr/local/bin/yq + + - name: Commit and push changes + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + cd tmp_wh + new_value="${{ needs.get-versions.outputs.combined_tag }}" + file_path="chart/values.yaml" + current_value=$(yq '.workspace.image.tag' "$file_path") + + + if [ "$current_value" = "$new_value" ]; then + echo "No changes to commit, skipping..." + else + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + yq -i ".workspace.image.tag = \"${new_value}\"" "$file_path" + git add $file_path + VERSION=${{ needs.get-versions.outputs.combined_tag }} + git commit -m "version $VERSION" + git push origin staging + fi + cd .. \ No newline at end of file From 97ed745bd56de592fa63be8173ef37884779dba1 Mon Sep 17 00:00:00 2001 From: MarkoBosnjak98 Date: Fri, 16 May 2025 12:24:29 +0200 Subject: [PATCH 2/5] Add npm run build to staging pipeline --- .github/workflows/cloud-staging-build.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cloud-staging-build.yaml b/.github/workflows/cloud-staging-build.yaml index f237f06d31..7d95f994f6 100644 --- a/.github/workflows/cloud-staging-build.yaml +++ b/.github/workflows/cloud-staging-build.yaml @@ -121,6 +121,7 @@ jobs: npm install npm run compile:ts npm install -g @vscode/vsce + npm run build vsce package cd .. From ee905a4e7eb441da2619c1ffc3e65bc4fef475b5 Mon Sep 17 00:00:00 2001 From: MarkoBosnjak98 Date: Fri, 16 May 2025 12:46:28 +0200 Subject: [PATCH 3/5] Use older vsce version, until microsoft fix false positives --- .github/workflows/cloud-staging-build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cloud-staging-build.yaml b/.github/workflows/cloud-staging-build.yaml index 7d95f994f6..620d809d68 100644 --- a/.github/workflows/cloud-staging-build.yaml +++ b/.github/workflows/cloud-staging-build.yaml @@ -120,7 +120,7 @@ jobs: cd tmp_extension npm install npm run compile:ts - npm install -g @vscode/vsce + npm install -g @vscode/vsce@3.3.2 npm run build vsce package cd .. From 0bc4c421bc9aa2bfd0fd6eff1f469993ddcc7414 Mon Sep 17 00:00:00 2001 From: mijauexe Date: Fri, 16 May 2025 14:28:56 +0200 Subject: [PATCH 4/5] Fix bugs related to quick implementation flow and redo flow --- core/agents/developer.py | 3 ++- core/agents/orchestrator.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/core/agents/developer.py b/core/agents/developer.py index a24aeb45f6..8cdbe2aee3 100644 --- a/core/agents/developer.py +++ b/core/agents/developer.py @@ -336,11 +336,12 @@ class Developer(ChatWithBreakdownMixin, RelevantFilesMixin, BaseAgent): "task_index": task_index, } ) - await self.send_message(f"Starting task #{task_index} with the description:\n\n" + description) + await self.send_message(f"Starting task #{task_index} with the description:\n\n{description}") if self.current_state.run_command: await self.ui.send_run_command(self.current_state.run_command) if self.next_state.current_task.get("redo_human_instructions", None) is not None: + await self.send_message(f"Additional feedback: {self.next_state.current_task['redo_human_instructions']}") return True if self.current_state.current_task.get("quick_implementation", False): diff --git a/core/agents/orchestrator.py b/core/agents/orchestrator.py index 7a7ee64e63..55d5de12f1 100644 --- a/core/agents/orchestrator.py +++ b/core/agents/orchestrator.py @@ -89,6 +89,8 @@ class Orchestrator(BaseAgent, GitMixin): branch_id=project_state.branch_id, step_index=project_state.step_index ) await self.state_manager.restore_files() + self.current_state.epics[-1]["completed"] = False + self.next_state.epics[-1]["completed"] = False self.next_state.current_task["redo_human_instructions"] = redo_human_instructions await self.update_stats() From 5aa9824d1b4e49abfebcf6389078a9877571bb7f Mon Sep 17 00:00:00 2001 From: mijauexe Date: Mon, 19 May 2025 11:23:21 +0200 Subject: [PATCH 5/5] Add specification description back --- core/agents/spec_writer.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/agents/spec_writer.py b/core/agents/spec_writer.py index 0e450efc8e..3dcb74cce8 100644 --- a/core/agents/spec_writer.py +++ b/core/agents/spec_writer.py @@ -92,6 +92,8 @@ class SpecWriter(BaseAgent): # if we do not set this and reload the project, we will load the "old" project description we entered before reload self.next_state.epics[0]["description"] = llm_assisted_description + self.next_state.specification.description = llm_assisted_description + await self.ui.send_project_description( { "project_description": llm_assisted_description,