Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ci: create tasks instead of workspaces in ai triage workflow#19940

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
johnstcn merged 11 commits intomainfromcj/traiage/integrate-tasks
Sep 25, 2025
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
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
64 changes: 32 additions & 32 deletions.github/workflows/traiage.yaml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,6 +12,11 @@ on:
required: true
default: "traiage"
type: string
template_preset:
description: "Template preset to use"
required: true
default: "Default"
type: string
prefix:
description: "Prefix for workspace name"
required: false
Expand DownExpand Up@@ -68,67 +73,62 @@ jobs:
coder whoami
echo "$HOME/.local/bin" >> "${GITHUB_PATH}"

- name: Create Coder workspace
id: create-workspace
# TODO(Cian): this is a good use-case for 'recipes'
- name: Create Coder task
id: create-task
env:
PREFIX: ${{ inputs.prefix }}
CONTEXT_KEY: ${{ steps.extract-context.outputs.context_key }}
GITHUB_TOKEN: ${{ github.token }}
ISSUE_URL: ${{ inputs.issue_url }}
PREFIX: ${{ inputs.prefix }}
RUN_ID: ${{ github.run_id }}
TEMPLATE_PARAMETERS: ${{ secrets.TRAIAGE_TEMPLATE_PARAMETERS }}
TEMPLATE_PRESET: ${{ inputs.template_preset }}
# TODO: replace with coder exp task command
APP_SLUG: ccw
run: |
export WORKSPACE_NAME="${PREFIX}-${CONTEXT_KEY}-${RUN_ID}"
echo "Creating workspace: $WORKSPACE_NAME"
./scripts/traiage.sh create
echo "workspace_name=$WORKSPACE_NAME" >> "${GITHUB_OUTPUT}"
echo "WORKSPACE_NAME=${WORKSPACE_NAME}" >> "${GITHUB_ENV}"

- name: Send prompt to AI agent inside workspace
id: prepare-prompt
env:
WORKSPACE_NAME: ${{ steps.create-workspace.outputs.workspace_name }}
ISSUE_URL: ${{ inputs.issue_url }}
GITHUB_TOKEN: ${{ github.token }}
run: |
PROMPT_FILE=$(mktemp)
trap 'rm -f "${PROMPT_FILE}"' EXIT

# Fetch issue description using `gh` CLI
issue_description=$(gh issue view "${ISSUE_URL}")

# Write a prompt to PROMPT_FILE
cat > "${PROMPT_FILE}" <<EOF
PROMPT=$(cat <<EOF
Analyze the below GitHub issue description, understand the root cause, and make appropriate changes to resolve the issue.

ISSUE URL: ${ISSUE_URL}
ISSUE DESCRIPTION BELOW:

${issue_description}
EOF
)
export PROMPT

echo "WORKSPACE_NAME: ${WORKSPACE_NAME}"
# This command will run the prompt inside the workspace
# and exit once the agent has completed the task.
PROMPT=$(cat "${PROMPT_FILE}") ./scripts/traiage.sh prompt
export TASK_NAME="${PREFIX}-${CONTEXT_KEY}-${RUN_ID}"
echo "Creating task: $TASK_NAME"
./scripts/traiage.sh create
./scripts/traiage.sh wait
echo "TASK_NAME=${TASK_NAME}" >> "${GITHUB_OUTPUT}"
echo "TASK_NAME=${TASK_NAME}" >> "${GITHUB_ENV}"

- name: Create and upload archive
id: create-archive
env:
BUCKET_PREFIX: "gs://coder-traiage-outputs/traiage"
run: |
echo "Creating archive for workspace: $WORKSPACE_NAME"
echo "Creating archive for workspace: $TASK_NAME"
./scripts/traiage.sh archive
echo "archive_url=${BUCKET_PREFIX%%/}/$WORKSPACE_NAME.tar.gz" >> "${GITHUB_OUTPUT}"
echo "archive_url=${BUCKET_PREFIX%%/}/$TASK_NAME.tar.gz" >> "${GITHUB_OUTPUT}"

- name: Generate a summary of the changes and post a comment on GitHub.
id: generate-summary
env:
ARCHIVE_URL: ${{ steps.create-archive.outputs.archive_url }}
APP_SLUG: ccw
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I know we have the required envs check, but I'm wondering if it'd be better to define thesetraiage.sh envs in one place so they're applied to all action steps?

Mayhaps doing something like this early on:

echo "APP_SLUG=$APP_SLUG" >> "$GITHUB_ENV"

(There's probably a better way to do it.)

Or write atraiage.config.sh which can be sourced intraiage.sh.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Long-term I want to remove the need for this (e.g by usingcoder task send). Leaving it here, exposed and ugly, makes it easier to delete later IMO.

mafredri reacted with thumbs up emoji
BUCKET_PREFIX: "gs://coder-traiage-outputs/traiage"
CONTEXT_KEY: ${{ steps.extract-context.outputs.context_key }}
GITHUB_TOKEN: ${{ github.token }}
GITHUB_REPOSITORY: ${{ github.repository }}
ISSUE_URL: ${{ inputs.issue_url }}
WORKSPACE_NAME: ${{ steps.create-workspace.outputs.workspace_name }}
TASK_NAME: ${{ steps.create-task.outputs.TASK_NAME }}
run: |
SUMMARY_FILE=$(mktemp)
trap 'rm -f "${SUMMARY_FILE}"' EXIT
Expand All@@ -137,15 +137,15 @@ jobs:
echo "## TrAIage Results"
echo "- **Issue URL:** ${ISSUE_URL}"
echo "- **Context Key:** ${CONTEXT_KEY}"
echo "- **Workspace:** ${WORKSPACE_NAME}"
echo "- **Workspace:** ${TASK_NAME}"
echo "- **Archive URL:** ${ARCHIVE_URL}"
echo
echo "${AUTO_SUMMARY}"
echo
echo "To fetch the output to your own workspace:"
echo
echo '```bash'
echo "BUCKET_PREFIX=${BUCKET_PREFIX}WORKSPACE_NAME=${WORKSPACE_NAME} ./scripts/traiage.sh resume"
echo "BUCKET_PREFIX=${BUCKET_PREFIX}TASK_NAME=${TASK_NAME} ./scripts/traiage.sh resume"
echo '```'
echo
} >> "${SUMMARY_FILE}"
Expand All@@ -157,8 +157,8 @@ jobs:
fi
cat "${SUMMARY_FILE}" >> "${GITHUB_STEP_SUMMARY}"

- name: Cleanupworkspace
if: steps.create-workspace.outputs.workspace_name != '' && steps.create-archive.outputs.archive_url != ''
- name: Cleanuptask
if: steps.create-task.outputs.TASK_NAME != '' && steps.create-archive.outputs.archive_url != ''
run: |
echo "Cleaning upworkspace: $WORKSPACE_NAME"
echo "Cleaning uptask: $TASK_NAME"
./scripts/traiage.sh delete || true
Loading
Loading

[8]ページ先頭

©2009-2025 Movatter.jp