feat: add GitHub Runner job template choice - #343
Conversation
|
Bugbot is not enabled for this team, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
✅ Linked to Linear issue ENG-2244 — status: In Progress The issue was already in progress and has been linked to this PR. Note Posted by Linear Issue Enforcer · Tag @mendral-app with feedback. |
🔀 Interaction Flow DiagramHere's how the new job template creation flow works based on the changes in this PR: sequenceDiagram
participant User
participant CLI as RunJobCreation
participant Create as runCreateFlow
participant JT as job_templates.go
participant Catalog as RetrieveTemplates
participant Clone as CloneTemplate
User->>CLI: bl create-job [dir] [--template] [--yes]
CLI->>Create: runCreateFlowWithDeps(config)
alt --yes flag without --template
Create-->>User: Error: --template required
end
Create->>Create: normalizeTemplateNameFlag()
Create->>Catalog: RetrieveTemplates("job")
Catalog-->>Create: available templates
alt No --template flag (interactive)
Create->>JT: PromptJobTemplateOptions(dir, templates)
JT->>JT: jobTemplateChoices(templates)
alt Multiple choices available
JT->>User: Select job type: Blank / GitHub Runner
User-->>JT: selection
end
alt Blank selected
JT->>Create: promptTemplateOptions(filtered blank templates)
Create->>User: Select language: Python / TypeScript
User-->>Create: language choice
else GitHub Runner selected
JT->>JT: CreateDefaultTemplateOptions(dir, runner)
end
JT-->>Create: TemplateOptions
end
Create->>JT: validateJobTemplateOptions(opts)
Note over JT: Runner → no language<br/>Blank → must have language
Create->>Clone: CloneTemplate(opts, templates)
Clone-->>Create: success
Create->>JT: printJobCreationSuccess(opts)
alt Blank job
JT-->>User: cd dir + sample batch command
else GitHub Runner
JT-->>User: Setup instructions (config, deploy, GitHub App)
end
Summary of the FlowThis PR introduces a specialized job creation path that branches the user experience based on template type:
Key design choices:
Note Posted by PR Sequence Diagram · Tag @mendral-app with feedback. |
🧪 Testing GuideWhat this PR addressesAdds a job-specific template picker to the Steps to exercise the new behaviorInteractive flow (requires TTY):
Non-interactive flow: Template listing: What to verify (expected behavior)
Note Posted by PR Testing Guide · Tag @mendral-app with feedback. |
|
You still have this ➜ toolkit git:(apatni/eng-2244-add-job-templates-to-cli-blank-and-github-runner) cd ..
For me you should simplify by removing the repo/owner from the original path (we can document it in the readme) 1 - bl deploy That's all |
|
ALso verify than you are up to date with this repo If you do both of them, just let me know and we merge |
There was a problem hiding this comment.
LGTM
The incremental change since the last review is a straightforward text simplification with matching test updates. No correctness, security, or logic issues. The strings import removal is correct since strings.Index calls were also removed.
Tag @mendral-app with feedback or questions. View session
|
@drappier-charles Your comment is implemented.
|
Summary
BlankversusGitHub Runnerpicker backed by the template catalog[githubRunner]in generated deployment specsTemplate and catalog
The official language-neutral template is published at https://github.com/blaxel-templates/template-github-runner. This PR intentionally does not embed its URL or runner assets in toolkit; discovery remains catalog-driven.
The repository contains the complete project at its root:
Dockerfileuses a Docker-capable Ubuntu 24.04 GitHub Actions runner image.start.shstarts Docker, configures IPv6/NAT64 egress, downloads execution task data, removes execution credentials from the environment, and starts the runner with its one-use JIT configuration.blaxel.tomldeclares the job runtime, ephemeral Docker storage, and GitHub repository allow-list.README.mddocuments deployment, GitHub App installation, runner labels, and settings-only redeployment.examples/workflow.ymlprovides an inactive workflow users can copy into.github/workflows.Template discovery and branch selection are separate:
template-github-runner, the official repository URL, and the topicsblaxel,job, andgithub-runner.defaultBranchfield when cloning. Its existing clone implementation selectsmainnormally and selectsdevelopwhenBL_ENVisdevorlocal.developupdates the dev catalog record; publishingmainupdates the production catalog record. This follows the release workflow used by existingblaxel-templatesrepositories.At runtime, the Blaxel GitHub integration supplies
JIT_CONFIGin execution task data. The template reads that one-use configuration, registers an ephemeral runner, executes one workflow job, and exits.Verification
go test ./...golangci-lint run --new-from-rev=origin/main ./...go build ./...make docbl new job --list -o jsonreturnstemplate-github-runnerfrom the dev cataloguname -a,docker info, anddocker run --rm hello-worldAutomatic
workflow_jobwebhook delivery remains dependent on the Blaxel GitHub App's permissions and event subscription; runtime verification used the same one-use JIT task payload directly after the installed App did not deliver that event. This is outside the toolkit change.Replaces #342 after the source fork was accidentally deleted and recreated.
Linear: ENG-2244
Note
Simplifies the post-scaffolding GitHub Runner setup guidance from 4 steps to 2, removing references to manual
blaxel.tomledits and--skip-builddeploys. Test assertions updated to match.Written by Mendral for commit 2ab7645.
Note
Medium Risk
Changes non-interactive job scaffolding semantics (
-ywithout-tnow fails) and adds pre-clone validation tied to catalog metadata; scope is CLI UX and deploy spec shaping, not auth or data stores.Overview
Adds a GitHub Runner path to
bl new job, alongside the existing Python/TypeScript blank starters, driven by what appears in the template catalog.Interactive flow now picks Blank vs GitHub Runner first; runner skips the language picker and blank jobs still use the language/template picker. Non-interactive
bl new job -ymust pass--template(e.g.github-runner,jobs-py), with validation before clone so runner templates cannot carry a language and blank jobs must matchpython/typescriptmetadata.Job
--listoutput is ordered and sanitized for terminal safety; post-create messaging differs for runner (deploy + console repo setup) vs batch jobs, with genericcd/bl runhints when the directory name is not shell-safe. Docs and examples are updated; deployment generation keeps[githubRunner]in job specs (covered by an integration test).Reviewed by Cursor Bugbot for commit 2ab7645. Bugbot is set up for automated code reviews on this repo. Configure here.