Apply close-older-issues logic to discussion fallbacks#13726
Merged
Conversation
- Pass close_older_discussions flag to create_issue handler - Map close_older_discussions to close_older_issues config - Add comprehensive tests for fallback scenario Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Add fallback-to-issue to create-discussion schema - Update close-older-discussions description to mention fallback behavior - Rebuild binary with updated schema Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
All checks passing: - Unit tests pass (3 new tests) - Related tests pass (create_issue, close_older_issues) - Go tests pass - Linter passes - All 145 workflows recompile successfully Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Apply code to close older fallback issues on discussion conversion
Apply close-older-issues logic to discussion fallbacks
Feb 4, 2026
pelikhan
approved these changes
Feb 4, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR resolves an issue where fallback issues created from failed discussion creation were accumulating without cleanup. When create-discussion with close-older-discussions: true falls back to creating an issue due to permissions errors, the PR ensures that older fallback issues are automatically closed using the existing close-older-issues logic.
Changes:
- Maps
close_older_discussionsconfiguration toclose_older_issueswhen initializing the fallback issue handler - Adds
fallback-to-issueproperty to the create-discussion schema for explicit configuration - Updates documentation to clarify that the close-older-issues behavior applies to fallback issues
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
pkg/parser/schemas/main_workflow_schema.json |
Added fallback-to-issue property and updated close-older-discussions description to document fallback behavior |
docs/src/content/docs/reference/frontmatter-full.md |
Updated documentation to match schema changes and clarify fallback behavior |
actions/setup/js/create_discussion.cjs |
Maps close_older_discussions config to close_older_issues when initializing fallback handler, enabling automatic cleanup |
actions/setup/js/create_discussion_fallback.test.cjs |
Comprehensive test coverage verifying close-older-issues applies correctly during fallback scenarios |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When
create-discussionwithclose-older-discussions: truefalls back to creating an issue (permissions failure), older fallback issues were accumulating without cleanup.Changes
Handler (
create_discussion.cjs):close_older_discussionsconfig toclose_older_issueswhen initializing fallback handlerSchema (
main_workflow_schema.json):fallback-to-issueproperty to create-discussion schemaclose-older-discussionsdescription to document fallback behaviorTests (
create_discussion_fallback.test.cjs):Example
When discussion creation fails, fallback issue is created and older fallback issues with matching workflow-id are automatically closed as "not planned".
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.