Skip to content

Conversation

Copy link

Copilot AI commented Sep 12, 2025

Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.

Original description:

Update the Copilot coding agent configuration and documentation on branch feature/copilot-config targeting develop. Apply the user's approved changes: make the issue number optional, use an incremental numeric uniqueness policy with leading zeros (pad width 2), max attempts 99, start at 1, and include slug rules. Update both files: .github/copilot-coding-agent.yml and docs/COPILOT_AGENT.md. Use branch name feature/copilot-config (update existing branch) and commit with message: "Update copilot agent config: optional issue + padded increment".

Files to add/update:

enabled: true

agent:
  name: copilot
  default_target_branch: develop
  pr_branch_prefix: feature/copilot/
  branch_name_template: "{prefix}{issue_part}{short-description}{uniq_part}"

  # Issue rendering (optional)
  issue_optional: true
  issue_prefix_with_number: true
  issue_separator: "-"   # only used if an issue exists

  # Use incremental numeric suffix on conflict, with leading zeros
  uniq_policy: "increment-if-conflict"   # none | increment-if-conflict | always-short
  uniq_separator: "-"                     # e.g. "-01"
  uniq_start: 1
  uniq_max_attempts: 99
  uniq_pad_width: 2                       # pad to 2 digits: 01, 02, ...; set to 3 for 001

  # Slug rules for {short-description}
  slug:
    lowercase: true
    space_replacement: "-"
    allowed_chars_regex: "[a-z0-9-]"
    collapse_multiple_hyphens: true
    max_length: 50

  pr_title_template: "[copilot] {short-description}"
  author:
    name: "Copilot"
    email: "[email protected]"
  create_prs: true
  allow_draft_prs: true
  reviewers:
    - codeGlaze

checks:
  run_tests: true
  run_linters: true
  run_cljs_build: true
  build_artifact: true
  upload_artifact: true

preferences:
  lint_fail_pr: false
  create_issue_on_failure: true
  issue_labels:
    - ci
    - copilot
  commit_message_prefix: "[copilot]"

hooks:
  before_pr:
    - "lein deps"
    - "lein with-profile +lint do deps, run -m clj-kondo.main --lint src test || true"
    - "lein test"
  after_pr:
    - "lein with-profile +dev cljsbuild once || true"

notes:
  - "If no issue is available the agent must produce {issue_part} == \"\" (no extra dash)."
  - "uniq_policy == increment-if-conflict: agent will try base, then base-01, base-02 ... up to uniq_max_attempts."
  - "uniq_pad_width controls leading zeros; set to 2 for 01..99, 3 for 001..999."
  - "On push rejection due to ref already existing, agent should increment and retry client-side, up to uniq_max_attempts."
```markdown
# Copilot Coding Agent — repository guidance

Branch naming & uniqueness
- Template: {prefix}{issue_part}{short-description}{uniq_part}
  - {prefix} is pr_branch_prefix (e.g. feature/copilot/)
  - {issue_part} is "<issue-number><issue_separator>" or "" when no issue (issue_optional: true)
  - {short-description} must be slugified (lowercase, spaces -> -, strip invalid chars)
  - {uniq_part} is added only when needed according to uniq_policy

Recommended uniqueness policy (configured here)
- uniq_policy: "increment-if-conflict"
- On conflict, agent tries:
  - base
  - base-{pad(1)} (e.g. -01)
  - base-{pad(2)} (e.g. -02)
  - ... up to uniq_max_attempts
- uniq_pad_width controls leading zeros for lexicographic sorting (default: 2)

Examples
- With issue: feature/copilot/42-add-base-class-editor
- Without issue: feature/copilot/add-base-class-editor
- On conflict (pad=2): feature/copilot/add-base-class-editor-01, feature/copilot/add-base-class-editor-02

Race handling
- If push fails because the ref already exists, agent should increment and retry locally.
- Limit retries (uniq_max_attempts) and fall back or surface for human review if exhausted.

CI validation (optional)
- Example regex (pad_width = 2): ^(?:feature/copilot/|copilot/)?(?:\d+-)?[a-z0-9]+(?:-[a-z0-9]+)*(?:-\d{2})?$

Security & best practices
- Keep secrets out of repo files.
- Keep before_pr hooks lightweight; leave heavy builds to CI.
- Adjust slug rules or pad width to match repo preferences.
```

Please update branch feature/copilot-config with these changes and push commits so the existing PR #8 is updated. Commit message: "Update copilot agent config: optional issue + padded increment".

This pull request was created as a result of the following prompt from Copilot chat.

Update the Copilot coding agent configuration and documentation on branch feature/copilot-config targeting develop. Apply the user's approved changes: make the issue number optional, use an incremental numeric uniqueness policy with leading zeros (pad width 2), max attempts 99, start at 1, and include slug rules. Update both files: .github/copilot-coding-agent.yml and docs/COPILOT_AGENT.md. Use branch name feature/copilot-config (update existing branch) and commit with message: "Update copilot agent config: optional issue + padded increment".

Files to add/update:

enabled: true

agent:
  name: copilot
  default_target_branch: develop
  pr_branch_prefix: feature/copilot/
  branch_name_template: "{prefix}{issue_part}{short-description}{uniq_part}"

  # Issue rendering (optional)
  issue_optional: true
  issue_prefix_with_number: true
  issue_separator: "-"   # only used if an issue exists

  # Use incremental numeric suffix on conflict, with leading zeros
  uniq_policy: "increment-if-conflict"   # none | increment-if-conflict | always-short
  uniq_separator: "-"                     # e.g. "-01"
  uniq_start: 1
  uniq_max_attempts: 99
  uniq_pad_width: 2                       # pad to 2 digits: 01, 02, ...; set to 3 for 001

  # Slug rules for {short-description}
  slug:
    lowercase: true
    space_replacement: "-"
    allowed_chars_regex: "[a-z0-9-]"
    collapse_multiple_hyphens: true
    max_length: 50

  pr_title_template: "[copilot] {short-description}"
  author:
    name: "Copilot"
    email: "[email protected]"
  create_prs: true
  allow_draft_prs: true
  reviewers:
    - codeGlaze

checks:
  run_tests: true
  run_linters: true
  run_cljs_build: true
  build_artifact: true
  upload_artifact: true

preferences:
  lint_fail_pr: false
  create_issue_on_failure: true
  issue_labels:
    - ci
    - copilot
  commit_message_prefix: "[copilot]"

hooks:
  before_pr:
    - "lein deps"
    - "lein with-profile +lint do deps, run -m clj-kondo.main --lint src test || true"
    - "lein test"
  after_pr:
    - "lein with-profile +dev cljsbuild once || true"

notes:
  - "If no issue is available the agent must produce {issue_part} == \"\" (no extra dash)."
  - "uniq_policy == increment-if-conflict: agent will try base, then base-01, base-02 ... up to uniq_max_attempts."
  - "uniq_pad_width controls leading zeros; set to 2 for 01..99, 3 for 001..999."
  - "On push rejection due to ref already existing, agent should increment and retry client-side, up to uniq_max_attempts."
```markdown
# Copilot Coding Agent — repository guidance

Branch naming & uniqueness
- Template: {prefix}{issue_part}{short-description}{uniq_part}
  - {prefix} is pr_branch_prefix (e.g. feature/copilot/)
  - {issue_part} is "<issue-number><issue_separator>" or "" when no issue (issue_optional: true)
  - {short-description} must be slugified (lowercase, spaces -> -, strip invalid chars)
  - {uniq_part} is added only when needed according to uniq_policy

Recommended uniqueness policy (configured here)
- uniq_policy: "increment-if-conflict"
- On conflict, agent tries:
  - base
  - base-{pad(1)} (e.g. -01)
  - base-{pad(2)} (e.g. -02)
  - ... up to uniq_max_attempts
- uniq_pad_width controls leading zeros for lexicographic sorting (default: 2)

Examples
- With issue: feature/copilot/42-add-base-class-editor
- Without issue: feature/copilot/add-base-class-editor
- On conflict (pad=2): feature/copilot/add-base-class-editor-01, feature/copilot/add-base-class-editor-02

Race handling
- If push fails because the ref already exists, agent should increment and retry locally.
- Limit retries (uniq_max_attempts) and fall back or surface for human review if exhausted.

CI validation (optional)
- Example regex (pad_width = 2): ^(?:feature/copilot/|copilot/)?(?:\d+-)?[a-z0-9]+(?:-[a-z0-9]+)*(?:-\d{2})?$

Security & best practices
- Keep secrets out of repo files.
- Keep before_pr hooks lightweight; leave heavy builds to CI.
- Adjust slug rules or pad width to match repo preferences.
```

Please update branch feature/copilot-config with these changes and push commits so the existing PR #8 is updated. Commit message: "Update copilot agent config: optional issue + padded increment".


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Sign up for free to 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.

2 participants