Skip to content

Split update-project into create-project and update-project safe outputs - #6077

Closed
mnkiefer with Copilot wants to merge 17 commits into
mainfrom
copilot/split-create-project-logic
Closed

Split update-project into create-project and update-project safe outputs#6077
mnkiefer with Copilot wants to merge 17 commits into
mainfrom
copilot/split-create-project-logic

Conversation

CopilotAI commented Dec 11, 2025

Copy link
Copy Markdown
Contributor

Summary of Changes

Addressed all PR feedback from @pelikhan:

  1. Changed default max from 10 to 1 for create-project

    • Updated in create_project.go, safe_outputs.go, main_workflow_schema.json, and documentation
  2. Moved generateCampaignId to separate helper file

    • Created project_helpers.cjs with generateCampaignId and new normalizeProjectName functions
    • Added extensive test suite in project_helpers.test.cjs (28 tests covering edge cases)
  3. Added project name normalization

    • Project names are now trimmed of whitespace before use
    • Validation ensures proper error messages for invalid inputs
  4. Removed PROJECT_GITHUB_TOKEN handling

    • Token is now properly configured via github-token parameter in step's with section
    • GitHub client automatically uses the configured token
    • Updated error messages to reference github-token configuration instead

Files Modified

  • pkg/workflow/create_project.go - Changed default max to 1
  • pkg/workflow/safe_outputs.go - Changed default max to 1
  • pkg/parser/schemas/main_workflow_schema.json - Updated schema defaults
  • docs/src/content/docs/reference/safe-outputs.md - Updated documentation
  • pkg/workflow/js/create_project.cjs - Use helpers, normalize names, remove PROJECT_GITHUB_TOKEN
  • pkg/workflow/js/create_project.test.cjs - Import generateCampaignId from helper

Files Added

  • pkg/workflow/js/project_helpers.cjs - Shared helper functions
  • pkg/workflow/js/project_helpers.test.cjs - Comprehensive test suite (28 tests)

Validation

  • ✅ All tests pass (project_helpers: 28/28, create_project: 8/8)
  • ✅ Code builds successfully
  • ✅ Linting passes
  • ✅ Formatting correct
Original prompt

Currently safe-output update-project also contains the logic to create a project if it does not exist. We want to split this to be consistent with the other safe-outputs granularity, so create a separate create-project and remove this logic from the current update-project.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

mnkieferand others added 5 commits December 11, 2025 00:09
…e projects
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
CopilotAI changed the title [WIP] Refactor safe-output by separating create project logicSplit update-project into create-project and update-project safe outputsDec 11, 2025
CopilotAI requested a review from mnkieferDecember 11, 2025 00:45
@mnkiefer
mnkiefer marked this pull request as ready for review December 11, 2025 00:48
@mnkiefer

Copy link
Copy Markdown
Collaborator

@pelikhan: As discussed yesterday, this splits the create-project from update-project. Please review before merging. 🙏🏼 Thank you!

Comment threaddocs/src/content/docs/reference/safe-outputs.md Outdated
Comment threadpkg/parser/schemas/main_workflow_schema.json
Comment threadpkg/workflow/create_project.go Outdated
Comment threadpkg/workflow/js/create_project.cjs Outdated
Comment threadpkg/workflow/js/create_project.cjs
Comment threadpkg/workflow/js/create_project.cjs Outdated
@pelikhan

Copy link
Copy Markdown
Collaborator

Did you test it with dev.md ?

… to helper, normalize project name, remove PROJECT_GITHUB_TOKEN
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@mnkiefer

Copy link
Copy Markdown
Collaborator

Did you test it with dev.md ?

This would mean modifying dev to test the create & update project scenarios and pushing that to main, then selecting this branch for testing? So if anyone else is currently testing their stuff with dev, they would be blocked, no?

@pelikhan

Copy link
Copy Markdown
Collaborator

No

  • you can trigger dev from the feature branch
  • it is designed to be a scratch pad, no one should rely on it being stable in main

@pelikhan

Copy link
Copy Markdown
Collaborator

Additionally, we should have at least one active agent uses these in some way. I think issue monster could maybe create a project when it discovers a cluster with 10+ issues

@pelikhan

Copy link
Copy Markdown
Collaborator

The job failed silently. Needs to fail the job.

https://github.com/githubnext/gh-aw/actions/runs/20135501447/job/57787808209#step:4:1

@pelikhan

Copy link
Copy Markdown
Collaborator

Well known environement variables should be prefixed with GH_AW_...

@githubgithub deleted a comment from github-actionsBotDec 11, 2025
@githubgithub deleted a comment from github-actionsBotDec 11, 2025
@mnkiefer

Copy link
Copy Markdown
Collaborator

The job failed silently. Needs to fail the job.

https://github.com/githubnext/gh-aw/actions/runs/20135501447/job/57787808209#step:4:1

Yes, still working on it, will ping you when ready. 👍🏼

@githubgithub deleted a comment from github-actionsBotDec 11, 2025
@githubgithub deleted a comment from github-actionsBotDec 11, 2025
@githubgithub deleted a comment from github-actionsBotDec 11, 2025
@pelikhan

Copy link
Copy Markdown
Collaborator

De-prioritized.

@pelikhan
pelikhan deleted the copilot/split-create-project-logic branch December 15, 2025 04:50
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@mnkiefer@pelikhan