feat: /create-repository - #34
Conversation
…l' into feature/repository-creation-skill # Conflicts: # skills/create-repository/SKILL.md
…l' into feature/repository-creation-skill
|
|
||
| Run `gh auth status`. If it exits non-zero, **stop immediately** and tell the user: | ||
|
|
||
| > This skill needs an authenticated GitHub CLI with org-admin permissions for AbsaOSS / absa-group. |
There was a problem hiding this comment.
I am not sure if the permissions that are needed are org-admin, its really high permission category.
| ### 4. Code owners (OSS repos only, ≥1 user) | ||
|
|
||
| **Only ask this for open source (`AbsaOSS`) repos.** Internal (`absa-group`) repos keep the template's | ||
| empty `CODEOWNERS`. An always-on org-level ruleset **prohibits committing straight to the default branch** |
There was a problem hiding this comment.
Why is the CODEOWNERS file for internal repositories empty in this step?
There was a problem hiding this comment.
It is because CSO team added to every internal repository a mandatory Check appid.json file workflow, that is added automatically. But they did not think about option to merge a commit straight without PR. So when we try to modify CODEOWNERS directly, the appid.json check is pending and the change is not possible without PR.
| If the `Write a different set of code owners` option is chosen, ask: "Enter the GitHub usernames for | ||
| the code owners." | ||
|
|
||
| A single global `CODEOWNERS` rule covers all files. Individuals only — no teams. |
| gh api -X PATCH repos/{owner}/{name} -F delete_branch_on_merge=true | ||
| ``` | ||
|
|
||
| 8. Link the repository to project number {number} (https://github.com/orgs/absa-group/projects/{number}). ← private repos only (one block per project); omit otherwise |
There was a problem hiding this comment.
I think it should automatically ask for adding the scope if the user token doesn't have it:
gh auth refresh -s read:project
There was a problem hiding this comment.
IMO, this skill should do only repository creation scoped commands. If person does not have permission to add it to the absa-group project, then someone with correct permission should do it instead.
This command is refreshing existing login token and requesting extra permission, which can be overlooked by skill user and cause not wanted outcomes.
| | Core Branches ruleset | ✓ | | ||
| | Auto-delete branches on merge | ✓ | | ||
|
|
||
| Template: https://github.com/absa-group/cps-repository-template |
There was a problem hiding this comment.
I am missing the information in this summary about which files are copied from the template repository. I think it can be useful for the user to know exactly what he created.
There was a problem hiding this comment.
You are right, I added under Template another row called: Files copied from the template. See commit: d395a5d
| Creates and configures a brand-new GitHub repository under the Absa organizations: AbsaOSS (open source) | ||
| or absa-group (internal). Runs a short interactive interview, then an annotated gh command plan that | ||
| creates the repo from the shared cps-repository-template (copies file structure) and, as part of that setup, | ||
| adds theApache-2.0 license and populated CODEOWNERS file (open source repos), the standard Absa |
There was a problem hiding this comment.
| adds theApache-2.0 license and populated CODEOWNERS file (open source repos), the standard Absa | |
| adds the Apache-2.0 license and populated CODEOWNERS file (open source repos), the standard Absa |
| set up a new repository, project, codebase, or service repo under AbsaOSS or absa-group. Even if they don't | ||
| say "repository" explicitly. Do NOT use for modifying an existing repo (adding a single label, granting | ||
| access on a repo that already exists, creating branches, pull requests, issues, or workflow files, or | ||
| cloning). Use only for creating a new repository from scratch. |
There was a problem hiding this comment.
Inwoiuld add Triggers on: 'create repository', 'new repo', 'spin up a repo', ..."
| that literal order, every time. For example (an OSS repo — no project-link row): | ||
|
|
||
| ``` | ||
| Repository `cps-test-repo` successfully created via /create-repository skill |
There was a problem hiding this comment.
The plan runs multiple sequential gh API calls (CODEOWNERS fetch, label clone, ruleset POST, project link GraphQL queries). For high-frequency use or edge cases, GitHub API rate limits could be hit. Consider noting this or adding defensive error handling guidance in the Execute section.
| ``` | ||
| Repository `cps-test-repo` successfully created via /create-repository skill | ||
|
|
||
| | Step | Result | |
There was a problem hiding this comment.
In would also add example when some step fail and describe how to handle it.
- back off to manual finish - provide commands and support user
- try retry
| code — the sentence goes above the block, the command goes in the block. Keep each description to one short | ||
| sentence; the user will ask if something is unclear. | ||
|
|
||
| ``` |
There was a problem hiding this comment.
Delete this line, it damages page format s reverse code sections.
|
|
||
| 8. Set the required org custom properties to placeholder values. ← private repos only; omit the whole step otherwise | ||
| ``` | ||
| gh api -X PATCH repos/{owner}/{name}/properties/values --input {skill-dir}/assets/custom-properties.json |
There was a problem hiding this comment.
The line references {skill-dir}/assets/custom-properties.json for setting custom properties on internal repos, but this file does not exist in the assets/ directory
Overview
This pull request introduces the new
create-repositoryskill, which automates the creation and configuration of GitHub repositories under the AbsaOSS (open source) or absa-group (internal) organizations. The skill runs an interactive interview, generates an annotatedghcommand plan, and executes it upon user confirmation, ensuring that all standard settings, labels, rules, and project links are applied consistently. The PR also adds robust documentation, a reusable ruleset asset, and evaluation scenarios to guide and test the skill.Key Changes
Related
Closes #https://github.com/absa-group/cps-organizational/issues/36