Skip to content

feat(gitlab): implement merge_after for automergeSchedule#37291

Open
dominikfoerster2003 wants to merge 5 commits intorenovatebot:mainfrom
dominikfoerster2003:feat/gitlab-merge-after-schedule
Open

feat(gitlab): implement merge_after for automergeSchedule#37291
dominikfoerster2003 wants to merge 5 commits intorenovatebot:mainfrom
dominikfoerster2003:feat/gitlab-merge-after-schedule

Conversation

@dominikfoerster2003
Copy link

@dominikfoerster2003 dominikfoerster2003 commented Aug 3, 2025

Changes

  • Add automergeSchedule and timezone to PlatformPrOptions interface
  • Extend getPlatformPrOptions to pass schedule configuration to platforms
  • Modify GitLab tryPrAutomerge to set merge_after when outside schedule
  • Use existing getNextScheduleTime and isScheduledNow functions
  • Support both Cron and Later.js schedule syntax with timezone awareness
  • Add comprehensive documentation for the new functionality

Context

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

@CLAassistant
Copy link

CLAassistant commented Aug 3, 2025

CLA assistant check
All committers have signed the CLA.

- Add automergeSchedule and timezone to PlatformPrOptions interface
- Extend getPlatformPrOptions to pass schedule configuration to platforms
- Modify GitLab tryPrAutomerge to set merge_after when outside schedule
- Use existing getNextScheduleTime and isScheduledNow functions
- Support both Cron and Later.js schedule syntax with timezone awareness
- Add comprehensive documentation for the new functionality

Closes renovatebot#37028
@dominikfoerster2003 dominikfoerster2003 force-pushed the feat/gitlab-merge-after-schedule branch from fd5bd35 to 3e17420 Compare August 3, 2025 11:45
@rarkins rarkins requested a review from viceice August 3, 2025 12:05
dominikfoerster2003 and others added 2 commits August 4, 2025 18:03
…implementation

- Fix dependency cycle by moving schedule logic to getPlatformPrOptions
- Fix TypeScript compilation errors in schedule.ts (croner API usage)
- Fix import issue in bazel-module/extract.ts (upath -> node:path)
- Update GitLab platform to use merge_after from platform options
- Ensure all lint checks pass (ESLint, Prettier, markdown-lint)

The implementation now properly integrates automergeSchedule with GitLab's
merge_after parameter to prevent merges outside configured schedules.

Fixes renovatebot#37028
Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

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

needs tests

- revert unrelated upath -> node:path change in bazel-module/extract.ts
- remove spurious blank line in gitlab/index.ts imports
- use Record<string, unknown> instead of any for requestBody
- drop unused automergeSchedule/timezone fields from PlatformPrOptions
- fix later.js next(1) returning Date instead of Date[] in getNextScheduleTime
- add tests for getNextScheduleTime covering null cases, later.js schedules,
  cron schedules, multiple schedules, timezone and schedule key parameter
- resolve conflict in pr/index.ts (keep getNextScheduleTime import, adopt .ts extensions)
- update is.array() -> isArray() after upstream switched to named import
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.

Support gitlab prevent merge before a specific date

3 participants