Skip to content

🐛 tlsprofiles: guard empty parse results; write JSON atomically#2648

Merged
openshift-merge-bot[bot] merged 1 commit intooperator-framework:mainfrom
tmshort:fix-tls-profile-nits
Apr 15, 2026
Merged

🐛 tlsprofiles: guard empty parse results; write JSON atomically#2648
openshift-merge-bot[bot] merged 1 commit intooperator-framework:mainfrom
tmshort:fix-tls-profile-nits

Conversation

@tmshort
Copy link
Copy Markdown
Contributor

@tmshort tmshort commented Apr 14, 2026

Panic in parseProfile if all curves or all pre-TLS-1.3 ciphers are skipped, preventing a silent zero-value profile. Download mozilla_data.json to a temp file and mv atomically to avoid leaving a corrupt file on partial curl failure.

Description

Reviewer Checklist

  • API Go Documentation
  • Tests: Unit Tests (and E2E Tests, if appropriate)
  • Comprehensive Commit Messages
  • Links to related GitHub Issue(s)

Panic in parseProfile if all curves or all pre-TLS-1.3 ciphers are
skipped, preventing a silent zero-value profile. Download mozilla_data.json
to a temp file and mv atomically to avoid leaving a corrupt file on
partial curl failure.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Todd Short <tshort@redhat.com>
Copilot AI review requested due to automatic review settings April 14, 2026 14:51
@netlify
Copy link
Copy Markdown

netlify bot commented Apr 14, 2026

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit 1b0448c
🔍 Latest deploy log https://app.netlify.com/projects/olmv1/deploys/69de548ff198bc000866365f
😎 Deploy Preview https://deploy-preview-2648--olmv1.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@openshift-ci openshift-ci bot requested review from pedjak and perdasilva April 14, 2026 14:52
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Fixes edge cases where TLS profile parsing could silently produce empty/zero-value fields, and makes the Mozilla JSON update script resilient to partial downloads by writing atomically.

Changes:

  • Add guards in parseProfile to panic if no supported curves (or no pre-TLS1.3 cipher suites) are resolved.
  • Update the TLS profile update script to download to a temp file and mv into place atomically.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
internal/shared/util/tlsprofiles/mozilla_data.go Adds validation to prevent empty curve/cipher results from being accepted silently.
hack/tools/update-tls-profiles.sh Downloads JSON to a temp file and atomically moves it into place to avoid corrupt outputs on failure.

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

panic(fmt.Sprintf("tlsprofiles: profile %q resolved no supported tls_curves from embedded mozilla_data.json", name))
}
if version < tlsVersion(tls.VersionTLS13) && len(cipherNums) == 0 {
panic(fmt.Sprintf("tlsprofiles: profile %q resolved no supported cipher suites from embedded mozilla_data.json", name))
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

This string literal is missing a closing quote (\") before the comma, which will cause the package to fail to compile. Add the missing quote so the fmt.Sprintf call is syntactically valid.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It obviously compiled since the CI passed.

@perdasilva
Copy link
Copy Markdown
Contributor

this is a small patch driven from a downstream review comment - it should be ok to downstream without major impact to QE efforts

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 14, 2026
Copy link
Copy Markdown
Member

@rashmigottipati rashmigottipati left a comment

Choose a reason for hiding this comment

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

/lgtm

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 14, 2026

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.91%. Comparing base (747fba3) to head (1b0448c).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
internal/shared/util/tlsprofiles/mozilla_data.go 0.00% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2648      +/-   ##
==========================================
+ Coverage   68.90%   68.91%   +0.01%     
==========================================
  Files         141      141              
  Lines       10005    10009       +4     
==========================================
+ Hits         6894     6898       +4     
  Misses       2595     2595              
  Partials      516      516              
Flag Coverage Δ
e2e 37.42% <0.00%> (+0.21%) ⬆️
experimental-e2e 52.51% <0.00%> (+0.04%) ⬆️
unit 53.61% <0.00%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@perdasilva
Copy link
Copy Markdown
Contributor

adding approved since Rashmi lgtmd

/approve

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 15, 2026
@pedjak
Copy link
Copy Markdown
Contributor

pedjak commented Apr 15, 2026

/override codecov/patch

@openshift-ci
Copy link
Copy Markdown

openshift-ci bot commented Apr 15, 2026

@pedjak: Overrode contexts on behalf of pedjak: codecov/patch

Details

In response to this:

/override codecov/patch

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.

Copy link
Copy Markdown
Member

@rashmigottipati rashmigottipati left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci
Copy link
Copy Markdown

openshift-ci bot commented Apr 15, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: perdasilva, rashmigottipati

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-merge-bot openshift-merge-bot bot merged commit 8ad71d4 into operator-framework:main Apr 15, 2026
30 of 31 checks passed
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. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants