Skip to content

USHIFT-6590: Align certificate expiry dates#6219

Open
pacevedom wants to merge 2 commits intoopenshift:mainfrom
pacevedom:USHIFT-6590
Open

USHIFT-6590: Align certificate expiry dates#6219
pacevedom wants to merge 2 commits intoopenshift:mainfrom
pacevedom:USHIFT-6590

Conversation

@pacevedom
Copy link
Contributor

@pacevedom pacevedom commented Feb 12, 2026

Summary by CodeRabbit

  • Refactor
    • Certificate expirations now align to the next midnight, so all certs end at a uniform day boundary.
  • Tests
    • Certificate-rotation tests adjusted to account for the aligned expiry calculations (expiry shifts by one day where applicable).
  • Documentation
    • Date-computation docs updated to reflect that expiry calculations use midnight-tomorrow as the anchor.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Feb 12, 2026
@openshift-ci-robot
Copy link

openshift-ci-robot commented Feb 12, 2026

@pacevedom: This pull request references USHIFT-6590 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target either version "4.22." or "openshift-4.22.", but it targets "openshift-4.21" instead.

Details

In response to this:

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot requested review from copejon and jogeo February 12, 2026 14:50
@pacevedom
Copy link
Contributor Author

/jira refresh

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 12, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pacevedom

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot
Copy link

openshift-ci-robot commented Feb 12, 2026

@pacevedom: This pull request references USHIFT-6590 which is a valid jira issue.

Details

In response to this:

/jira refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai
Copy link

coderabbitai bot commented Feb 12, 2026

📝 Walkthrough

Walkthrough

Aligns certificate expirations to the next midnight by adding alignValidity and applying it to certificate validity values in certSetup; updates a certificate-rotation test to account for the aligned expiry calculations.

Changes

Cohort / File(s) Summary
Certificate Validity Alignment
pkg/cmd/init.go
Adds alignValidity helper that computes duration until next midnight plus base validity; replaces direct uses of cryptomaterial.ShortLivedCertificateValidity and cryptomaterial.LongLivedCertificateValidity with aligned values; introduces startTime and nextMidnight anchors.
Tests — certificate rotation
test/suites/standard2/validate-certificate-rotation.robot
Adjusts expiry calculations to account for the alignment (uses 366 + FUTURE_DAYS and computes dates relative to tomorrow's midnight); updates comments and date computation commands accordingly.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'USHIFT-6590: Align certificate expiry dates' directly and clearly summarizes the main change: aligning certificate expiration dates to the next midnight boundary.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
test/suites/standard2/validate-certificate-rotation.robot (1)

82-82: Pre-existing typo: "ceritifate" → "certificate".

Not introduced by this PR, but worth a drive-by fix if you're already touching this file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 12, 2026
@openshift-ci-robot
Copy link

openshift-ci-robot commented Feb 12, 2026

@pacevedom: This pull request references USHIFT-6590 which is a valid jira issue.

Details

In response to this:

Summary by CodeRabbit

  • Refactor
  • Aligned certificate expiration times to occur uniformly at the next midnight boundary, improving consistency and predictability of certificate lifecycle management.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@pkg/cmd/init.go`:
- Around line 66-77: The code builds nextMidnight and alignValidity using the
local time zone via startTime := time.Now(); replace this with UTC to avoid DST
drift: set startTime to time.Now().UTC() (and ensure nextMidnight is constructed
in that same UTC location) so that nextMidnight, targetExpiration and the
alignValidity(baseValidity) calculation are anchored to a fixed UTC midnight
rather than a potentially-shifting local midnight; update references to
startTime, nextMidnight and alignValidity accordingly.

@openshift-ci-robot
Copy link

openshift-ci-robot commented Feb 13, 2026

@pacevedom: This pull request references USHIFT-6590 which is a valid jira issue.

Details

In response to this:

Summary by CodeRabbit

  • Refactor
  • Certificate expirations now align to the next midnight, so all certs end at a uniform day boundary.
  • Tests
  • Certificate-rotation tests adjusted to account for the aligned expiry calculations (expiry shifts by one day where applicable).
  • Documentation
  • Date-computation docs updated to reflect that expiry calculations use midnight-tomorrow as the anchor.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@pacevedom
Copy link
Contributor Author

/retest

@pacevedom
Copy link
Contributor Author

/override ci/prow/ocp-full-conformance-rhel-eus ci/prow/ocp-full-conformance-serial-rhel-eus

Failures are because of unrelated issues being taken care of in a different PR.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 17, 2026

@pacevedom: Overrode contexts on behalf of pacevedom: ci/prow/ocp-full-conformance-rhel-eus, ci/prow/ocp-full-conformance-serial-rhel-eus

Details

In response to this:

/override ci/prow/ocp-full-conformance-rhel-eus ci/prow/ocp-full-conformance-serial-rhel-eus

Failures are because of unrelated issues being taken care of in a different PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 17, 2026

@pacevedom: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@pacevedom
Copy link
Contributor Author

/verified by CI

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Feb 17, 2026
@openshift-ci-robot
Copy link

@pacevedom: This PR has been marked as verified by CI.

Details

In response to this:

/verified by CI

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants