Skip to content

feat: Support business window constraint#771

Merged
simoneb merged 3 commits into
fastify:mainfrom
kibertoad:feat/business-window
Jun 10, 2026
Merged

feat: Support business window constraint#771
simoneb merged 3 commits into
fastify:mainfrom
kibertoad:feat/business-window

Conversation

@kibertoad

Copy link
Copy Markdown
Member

fixes #770

Checklist

@kibertoad kibertoad marked this pull request as ready for review June 8, 2026 14:40
@kibertoad kibertoad requested a review from simoneb June 8, 2026 14:40
@simoneb simoneb requested a review from Copilot June 8, 2026 14:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for restricting auto-merge behavior to a configurable “business hours” window, addressing #770 by introducing a 5-field cron-based merge window with optional IANA timezone evaluation. When outside the configured window, the action skips merging and exposes a distinct merge_status.

Changes:

  • Introduces merge-window / merge-window-timezone inputs and documents them.
  • Adds a cron parser + time-window evaluator (src/mergeWindow.js) with unit tests.
  • Integrates merge-window evaluation into the action flow and adds a new skip status (skipped:outside_merge_window).

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/util.test.js Adds coverage for new input parsing/whitespace trimming.
test/mergeWindow.test.js Adds unit tests for cron parsing and window matching behavior.
test/action.test.js Adds action-level behavior tests for skipping/merging based on merge-window.
src/util.js Adds new inputs to getInputs() and new merge status constant.
src/mergeWindow.js Implements cron parsing and “is now within merge window” logic.
src/action.js Skips merge when outside the configured merge window; sets output status + log.
README.md Documents new inputs, output status, and provides usage guidance.
dist/index.js Bundled output updated to include merge-window feature.
action.yml Declares new action inputs for merge-window and timezone.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/mergeWindow.js
Comment thread test/mergeWindow.test.js

@simoneb simoneb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@simoneb simoneb merged commit 16f49a8 into fastify:main Jun 10, 2026
3 checks passed
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.

Business hours constraint

3 participants