Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 7, 2026

Plan: Set Default Expiration on create-discussion to 7d

  • Add default expiration logic in parseDiscussionsConfig() function
  • Set Expires to 168 hours (7 days) when not explicitly configured
  • Add test cases to verify the default behavior
  • Update existing tests if needed
  • Run unit tests to validate changes
  • Manual verification of compilation behavior
  • Recompile all workflow files to apply default expiration
  • Update JSON schema to document the default value
  • Merge main branch
  • Run linting

Changes Made

  1. Updated pkg/workflow/create_discussion.go:

    • Added logic to set default expiration of 168 hours (7 days) when expires field is not specified or is 0
    • Improved pre-processing to handle both integer and string formats for the expires field
    • Added debug logging to indicate when default expiration is used
  2. Added tests in pkg/workflow/create_discussion_dependencies_test.go:

    • Added TestParseDiscussionsConfigDefaultExpiration to verify default behavior
    • Tests cover: no expires field, explicit integer, explicit string format, and explicit zero value
  3. Updated pkg/parser/schemas/main_workflow_schema.json:

    • Added "default": 7 to the expires field for create-discussion
    • Updated description to mention "Defaults to 7 days if not specified"
    • This documents the default behavior in the schema for tooling and IDE support
  4. Recompiled 35 workflow lock files:

    • All workflows using create-discussion without explicit expires now have default "expires":168 in their configuration
    • This ensures discussions will auto-expire after 7 days unless explicitly configured otherwise
  5. Merged main branch (commit 89cc3a8):

    • Successfully merged latest changes from main
    • No merge conflicts
    • All tests still pass after merge

Verification

✅ All unit tests pass including the new tests
✅ Manual compilation test confirms default expiration is set correctly (verified via debug logs and compiled YAML)
✅ The default value (168 hours = 7 days) is properly passed to the JavaScript handler through GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG
✅ 35 workflow lock files updated with default expiration value
✅ JSON schema updated to document the default value
✅ Schema validation tests pass
✅ Merged with main branch successfully
✅ Linting passes

Original prompt

Set the default expiration on "create-discussion" to "7d" (7 days).


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

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

pelikhan commented Jan 7, 2026

@copilot update JSON schema

Copilot AI and others added 2 commits January 7, 2026 14:20
…ssion

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

pelikhan commented Jan 7, 2026

@copilot keep working

@pelikhan
Copy link
Contributor

pelikhan commented Jan 7, 2026

@copilot keep working

…eate-discussion

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

Copilot AI commented Jan 7, 2026

@copilot keep working

Updated the JSON schema to document the default expires value of 7 days for create-discussion. Added "default": 7 to the schema and updated the description. Commit b73647f

Copilot AI changed the title [WIP] Set default expiration on create discussion to 7 days Set default expiration on create discussion to 7 days Jan 7, 2026
@pelikhan pelikhan marked this pull request as ready for review January 7, 2026 15:46
@pelikhan
Copy link
Contributor

pelikhan commented Jan 7, 2026

@copilot merge main, lint

Copy link
Contributor Author

Copilot AI commented Jan 7, 2026

@copilot merge main, lint

Merged main branch successfully and linting passes. Commit 89cc3a8

@pelikhan pelikhan merged commit 72f805e into main Jan 7, 2026
3 checks passed
@pelikhan pelikhan deleted the copilot/set-default-expiration-discussion branch January 7, 2026 19:04
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