Skip to content

Comments

Add label support to update-discussion safe output#6968

Merged
mnkiefer merged 9 commits intomainfrom
copilot/update-safe-output-labels
Dec 19, 2025
Merged

Add label support to update-discussion safe output#6968
mnkiefer merged 9 commits intomainfrom
copilot/update-safe-output-labels

Conversation

Copy link
Contributor

Copilot AI commented Dec 19, 2025

Plan: Add allowed-labels support to update-discussion

  • Update UpdateDiscussionsConfig struct to include Labels and AllowedLabels fields
  • Update parseUpdateDiscussionsConfig to parse labels and allowed-labels configuration
  • Update schema file to include labels and allowed-labels in update-discussion definition
  • Update agent-output.json schema to include labels field in update_discussion type
  • Update update_discussion.cjs to handle label updates via GraphQL
  • Update generateSafeOutputsConfig to include allowed-labels in update_discussion config
  • Run make build to rebuild with embedded schemas
  • Run make recompile to recompile all workflows
  • Add tests for parsing allowed-labels in update-discussion
  • Add tests for label updates in update_discussion.test.cjs
  • Run tests to validate the changes
  • All tests passing (Go unit tests and JavaScript tests)
  • Manual testing with test workflow - verified labels are correctly configured
  • Run make lint - all checks pass
  • Merge main branch and resolve conflicts (multiple times)
  • Make allowed-labels implicitly enable labels

Summary

This PR adds support for updating discussion labels in the update-discussion safe output. All requested changes have been addressed:

  • ✅ Linting issues fixed with make fmt
  • ✅ Merge conflicts resolved by merging main and recompiling workflows (multiple times)
  • allowed-labels now implicitly enables labels - users don't need to specify both
  • ✅ Up to date with latest main branch

Key Feature: Implicit Label Enablement

When allowed-labels is specified, the labels field is automatically enabled. This improves user experience by eliminating redundancy:

Before:

safe-outputs:
  update-discussion:
    labels:
    allowed-labels: [bug, enhancement]

After:

safe-outputs:
  update-discussion:
    allowed-labels: [bug, enhancement]  # implicitly enables labels

The implementation maintains backward compatibility - users can still explicitly specify both fields if desired.

Original prompt

Update safe output update-discussion to support adding labels as well, from an allowed-labels list.


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

mnkiefer and others added 2 commits December 19, 2025 15:14
- Updated UpdateDiscussionsConfig struct to include Labels and AllowedLabels fields
- Updated parseUpdateDiscussionsConfig to parse labels and allowed-labels
- Updated generateSafeOutputsConfig to include allowed_labels in update_discussion config
- Updated JSON schema to support labels and allowed-labels fields
- Updated agent-output.json schema to include labels field in update_discussion type
- Implemented label update logic in update_discussion.cjs using GraphQL mutations
- Schema changes embedded in binary via make build
- All workflows recompiled successfully

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
@mnkiefer mnkiefer marked this pull request as ready for review December 19, 2025 14:29
@mnkiefer
Copy link
Contributor

@copilot: make lint.

@mnkiefer
Copy link
Contributor

@copilot: Resolve merge conflicts.

- Added Go tests for update-discussion configuration parsing with labels
- Added JavaScript tests for discussion label updates
- Fixed update_discussion.cjs to only query labels when needed
- Updated update_runner.cjs to support labels parameter
- Added canUpdateLabels to buildUpdateData function
- Fixed existing tests to account for additional final query
- All unit tests and JavaScript tests now pass

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copilot AI changed the title [WIP] Update safe output to add labels from allowed list Add label support to update-discussion safe output Dec 19, 2025
Copilot AI requested a review from mnkiefer December 19, 2025 14:52
@pelikhan
Copy link
Contributor

@copilot allowed-labels should implicitely enable labels.

- Fixed JavaScript formatting issues in update_discussion files
- Merged origin/main to bring in latest changes
- Resolved merge conflicts by recompiling all workflows
- All linting checks now pass

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 19, 2025

@copilot: Resolve merge conflicts.

Done. Merged origin/main and resolved all merge conflicts by rebuilding and recompiling workflows with make build && make recompile. Commit: 11a9199

@copilot: make lint.

Done. Linting now passes after running make fmt to fix formatting issues in the JavaScript files. Commit: 11a9199

- Modified parseUpdateDiscussionsConfig to automatically set Labels when AllowedLabels is present
- Updated buildUpdateDiscussionStepConfig to set GH_AW_UPDATE_LABELS env var when Labels is enabled
- Added test TestUpdateDiscussionConfigAllowedLabelsImplicitlyEnablesLabels to verify behavior
- Users can now specify only allowed-labels without explicitly adding labels:
- All tests pass and linting is clean

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 19, 2025

@copilot allowed-labels should implicitely enable labels.

Done. When allowed-labels is specified, labels is now implicitly enabled. Users can now use:

safe-outputs:
  update-discussion:
    allowed-labels: [bug, enhancement]  # labels implicitly enabled

Instead of requiring both fields. Commit: 5eb1148

@mnkiefer
Copy link
Contributor

@copilot: merge main and recompile.

- Merged latest changes from origin/main
- Resolved merge conflicts in pkg/workflow/compiler_yaml.go by accepting main version
- Resolved merge conflicts in lock files by recompiling all workflows
- All workflows recompiled successfully (117 out of 119)

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 19, 2025

@copilot: merge main and recompile.

Done. Merged origin/main and resolved merge conflicts. All workflows recompiled successfully (117 out of 119). Commit: dc0a8c7

@mnkiefer mnkiefer merged commit dc0796c into main Dec 19, 2025
41 checks passed
@mnkiefer mnkiefer deleted the copilot/update-safe-output-labels branch December 19, 2025 15:57
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.

3 participants