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

Commit063e863

Browse files
ci: create tasks instead of workspaces in ai triage workflow (#19940)
Co-authored-by: Danielle Maywood <danielle@themaywoods.com>
1 parent252f430 commit063e863

File tree

2 files changed

+201
-96
lines changed

2 files changed

+201
-96
lines changed

‎.github/workflows/traiage.yaml‎

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ on:
1212
required:true
1313
default:"traiage"
1414
type:string
15+
template_preset:
16+
description:"Template preset to use"
17+
required:true
18+
default:"Default"
19+
type:string
1520
prefix:
1621
description:"Prefix for workspace name"
1722
required:false
@@ -68,67 +73,62 @@ jobs:
6873
coder whoami
6974
echo "$HOME/.local/bin" >> "${GITHUB_PATH}"
7075
71-
-name:Create Coder workspace
72-
id:create-workspace
76+
# TODO(Cian): this is a good use-case for 'recipes'
77+
-name:Create Coder task
78+
id:create-task
7379
env:
74-
PREFIX:${{ inputs.prefix }}
7580
CONTEXT_KEY:${{ steps.extract-context.outputs.context_key }}
81+
GITHUB_TOKEN:${{ github.token }}
82+
ISSUE_URL:${{ inputs.issue_url }}
83+
PREFIX:${{ inputs.prefix }}
7684
RUN_ID:${{ github.run_id }}
7785
TEMPLATE_PARAMETERS:${{ secrets.TRAIAGE_TEMPLATE_PARAMETERS }}
86+
TEMPLATE_PRESET:${{ inputs.template_preset }}
87+
# TODO: replace with coder exp task command
88+
APP_SLUG:ccw
7889
run:|
79-
export WORKSPACE_NAME="${PREFIX}-${CONTEXT_KEY}-${RUN_ID}"
80-
echo "Creating workspace: $WORKSPACE_NAME"
81-
./scripts/traiage.sh create
82-
echo "workspace_name=$WORKSPACE_NAME" >> "${GITHUB_OUTPUT}"
83-
echo "WORKSPACE_NAME=${WORKSPACE_NAME}" >> "${GITHUB_ENV}"
84-
85-
-name:Send prompt to AI agent inside workspace
86-
id:prepare-prompt
87-
env:
88-
WORKSPACE_NAME:${{ steps.create-workspace.outputs.workspace_name }}
89-
ISSUE_URL:${{ inputs.issue_url }}
90-
GITHUB_TOKEN:${{ github.token }}
91-
run:|
92-
PROMPT_FILE=$(mktemp)
93-
trap 'rm -f "${PROMPT_FILE}"' EXIT
94-
9590
# Fetch issue description using `gh` CLI
9691
issue_description=$(gh issue view "${ISSUE_URL}")
9792
9893
# Write a prompt to PROMPT_FILE
99-
cat > "${PROMPT_FILE}" <<EOF
94+
PROMPT=$(cat <<EOF
10095
Analyze the below GitHub issue description, understand the root cause, and make appropriate changes to resolve the issue.
10196
10297
ISSUE URL: ${ISSUE_URL}
10398
ISSUE DESCRIPTION BELOW:
10499
105100
${issue_description}
106101
EOF
102+
)
103+
export PROMPT
107104
108-
echo "WORKSPACE_NAME: ${WORKSPACE_NAME}"
109-
# This command will run the prompt inside the workspace
110-
# and exit once the agent has completed the task.
111-
PROMPT=$(cat "${PROMPT_FILE}") ./scripts/traiage.sh prompt
105+
export TASK_NAME="${PREFIX}-${CONTEXT_KEY}-${RUN_ID}"
106+
echo "Creating task: $TASK_NAME"
107+
./scripts/traiage.sh create
108+
./scripts/traiage.sh wait
109+
echo "TASK_NAME=${TASK_NAME}" >> "${GITHUB_OUTPUT}"
110+
echo "TASK_NAME=${TASK_NAME}" >> "${GITHUB_ENV}"
112111
113112
-name:Create and upload archive
114113
id:create-archive
115114
env:
116115
BUCKET_PREFIX:"gs://coder-traiage-outputs/traiage"
117116
run:|
118-
echo "Creating archive for workspace: $WORKSPACE_NAME"
117+
echo "Creating archive for workspace: $TASK_NAME"
119118
./scripts/traiage.sh archive
120-
echo "archive_url=${BUCKET_PREFIX%%/}/$WORKSPACE_NAME.tar.gz" >> "${GITHUB_OUTPUT}"
119+
echo "archive_url=${BUCKET_PREFIX%%/}/$TASK_NAME.tar.gz" >> "${GITHUB_OUTPUT}"
121120
122121
-name:Generate a summary of the changes and post a comment on GitHub.
123122
id:generate-summary
124123
env:
125124
ARCHIVE_URL:${{ steps.create-archive.outputs.archive_url }}
125+
APP_SLUG:ccw
126126
BUCKET_PREFIX:"gs://coder-traiage-outputs/traiage"
127127
CONTEXT_KEY:${{ steps.extract-context.outputs.context_key }}
128128
GITHUB_TOKEN:${{ github.token }}
129129
GITHUB_REPOSITORY:${{ github.repository }}
130130
ISSUE_URL:${{ inputs.issue_url }}
131-
WORKSPACE_NAME:${{ steps.create-workspace.outputs.workspace_name }}
131+
TASK_NAME:${{ steps.create-task.outputs.TASK_NAME }}
132132
run:|
133133
SUMMARY_FILE=$(mktemp)
134134
trap 'rm -f "${SUMMARY_FILE}"' EXIT
@@ -137,15 +137,15 @@ jobs:
137137
echo "## TrAIage Results"
138138
echo "- **Issue URL:** ${ISSUE_URL}"
139139
echo "- **Context Key:** ${CONTEXT_KEY}"
140-
echo "- **Workspace:** ${WORKSPACE_NAME}"
140+
echo "- **Workspace:** ${TASK_NAME}"
141141
echo "- **Archive URL:** ${ARCHIVE_URL}"
142142
echo
143143
echo "${AUTO_SUMMARY}"
144144
echo
145145
echo "To fetch the output to your own workspace:"
146146
echo
147147
echo '```bash'
148-
echo "BUCKET_PREFIX=${BUCKET_PREFIX}WORKSPACE_NAME=${WORKSPACE_NAME} ./scripts/traiage.sh resume"
148+
echo "BUCKET_PREFIX=${BUCKET_PREFIX}TASK_NAME=${TASK_NAME} ./scripts/traiage.sh resume"
149149
echo '```'
150150
echo
151151
} >> "${SUMMARY_FILE}"
@@ -157,8 +157,8 @@ jobs:
157157
fi
158158
cat "${SUMMARY_FILE}" >> "${GITHUB_STEP_SUMMARY}"
159159
160-
-name:Cleanupworkspace
161-
if:steps.create-workspace.outputs.workspace_name != '' && steps.create-archive.outputs.archive_url != ''
160+
-name:Cleanuptask
161+
if:steps.create-task.outputs.TASK_NAME != '' && steps.create-archive.outputs.archive_url != ''
162162
run:|
163-
echo "Cleaning upworkspace: $WORKSPACE_NAME"
163+
echo "Cleaning uptask: $TASK_NAME"
164164
./scripts/traiage.sh delete ||true

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp