Skip to content

CNF-23047: Migrate away from deprecated ioutil#1072

Open
sebrandon1 wants to merge 1 commit into
openshift:mainfrom
sebrandon1:ioutil_deprecation
Open

CNF-23047: Migrate away from deprecated ioutil#1072
sebrandon1 wants to merge 1 commit into
openshift:mainfrom
sebrandon1:ioutil_deprecation

Conversation

@sebrandon1
Copy link
Copy Markdown
Member

@sebrandon1 sebrandon1 commented Nov 24, 2025

ioutil has been deprecated since Go 1.16: https://go.dev/doc/go1.16#ioutil

Tracking issue: redhat-best-practices-for-k8s/telco-bot#52

Summary by CodeRabbit

  • Chores
    • Updated internal file-reading implementation to remove use of deprecated APIs, tidy imports, and modernize code usage. This is a maintenance change with no behavior or public API changes, intended to improve code hygiene and future compatibility.

@openshift-ci openshift-ci Bot requested review from jhadvig and spadgett November 24, 2025 18:12
@jhadvig jhadvig changed the title Migrate away from deprecated ioutil NO-JIRA: (chore) Migrate away from deprecated ioutil Jan 8, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jan 8, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@sebrandon1: This pull request explicitly references no jira issue.

Details

In response to this:

ioutil has been deprecated since Go 1.16: https://go.dev/doc/go1.16#ioutil

Tracking issue: redhat-best-practices-for-k8s/telco-bot#52

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
Copy Markdown
Member

@jhadvig jhadvig left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@jhadvig
Copy link
Copy Markdown
Member

jhadvig commented Jan 8, 2026

/override ci/prow/e2e-gcp-ovn

@openshift-ci openshift-ci Bot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jan 8, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Jan 8, 2026

@jhadvig: Overrode contexts on behalf of jhadvig: ci/prow/e2e-gcp-ovn

Details

In response to this:

/override ci/prow/e2e-gcp-ovn

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 openshift-ci Bot removed the lgtm Indicates that a PR is ready to be merged. label Jan 16, 2026
@sebrandon1
Copy link
Copy Markdown
Member Author

/retest

@jhadvig
Copy link
Copy Markdown
Member

jhadvig commented Mar 4, 2026

/retest

@jhadvig
Copy link
Copy Markdown
Member

jhadvig commented Apr 2, 2026

/verified by CI
/lgtm

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Apr 2, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

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

Details

In response to this:

/verified by CI
/lgtm

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 added the lgtm Indicates that a PR is ready to be merged. label Apr 2, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 2, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jhadvig, sebrandon1

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

@jhadvig jhadvig added the jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. label Apr 2, 2026
@openshift-merge-bot
Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD b9608d2 and 2 for PR HEAD 334e8b8 in total

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD 4bd76c3 and 1 for PR HEAD 334e8b8 in total

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD f061939 and 0 for PR HEAD 334e8b8 in total

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

/hold

Revision 334e8b8 was retested 3 times: holding

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 7, 2026
@openshift-bot
Copy link
Copy Markdown
Contributor

/jira refresh

The requirements for Jira bugs have changed (Jira issues linked to PRs on main branch need to target different OCP), recalculating validity.

@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@openshift-bot: This pull request explicitly references no jira issue.

Retaining the jira/valid-bug label as it was manually added.

Details

In response to this:

/jira refresh

The requirements for Jira bugs have changed (Jira issues linked to PRs on main branch need to target different OCP), recalculating validity.

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.

@sebrandon1
Copy link
Copy Markdown
Member Author

/retest

@sebrandon1 sebrandon1 changed the title NO-JIRA: (chore) Migrate away from deprecated ioutil CNF-23047: Migrate away from deprecated ioutil Apr 20, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

openshift-ci-robot commented Apr 20, 2026

@sebrandon1: This pull request references CNF-23047 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 story to target the "5.0.0" version, but no target version was set.

Retaining the jira/valid-bug label as it was manually added.

Details

In response to this:

ioutil has been deprecated since Go 1.16: https://go.dev/doc/go1.16#ioutil

Tracking issue: redhat-best-practices-for-k8s/telco-bot#52

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-robot openshift-ci-robot removed the verified Signifies that the PR passed pre-merge verification criteria label Apr 30, 2026
@openshift-ci openshift-ci Bot removed the lgtm Indicates that a PR is ready to be merged. label Apr 30, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 30, 2026

New changes are detected. LGTM label has been removed.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 30, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: a127b9ea-f4a8-4ad3-a0a4-2d8052983632

📥 Commits

Reviewing files that changed from the base of the PR and between 66da564 and d8a2084.

⛔ Files ignored due to path filters (1)
  • test/e2e/metrics_test.go is excluded by !**/*_test.go
📒 Files selected for processing (1)
  • tools/import-verifier/import-verifier.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • tools/import-verifier/import-verifier.go

Walkthrough

The code modernizes file I/O in loadImportRestrictions by replacing ioutil.ReadFile with os.ReadFile and removes the unused io/ioutil import. No control flow, signatures, or public APIs were changed.

Changes

Import and file-read modernization

Layer / File(s) Summary
Replace deprecated ioutil.ReadFile with os.ReadFile
tools/import-verifier/import-verifier.go
Updated loadImportRestrictions to call os.ReadFile(configFile) instead of ioutil.ReadFile(configFile) and removed the unused io/ioutil import. No other logic was modified.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 10 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description does not follow the required template structure with sections like Analysis/Root cause, Solution description, Test setup, Test cases, and Browser conformance. It only provides minimal context about the deprecation. Fill in the description template with all required sections: Analysis/Root cause, Solution description, Test setup, Test cases, Browser conformance, and Additional info.
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 (10 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: migrating away from the deprecated ioutil package, which matches the file-level change in import-verifier.go.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed Custom check for Ginkgo test names is not applicable. Repository uses standard Go testing framework (testing.T), not Ginkgo. No Ginkgo test structures found in codebase or PR modifications.
Test Structure And Quality ✅ Passed PR only modifies ioutil deprecation in a utility tool. Check assesses Ginkgo test code. Repository has no tests and doesn't use Ginkgo. Not applicable.
Microshift Test Compatibility ✅ Passed No new Ginkgo e2e tests are added in this PR. The change only modernizes file reading in a Go utility tool by replacing deprecated ioutil.ReadFile with os.ReadFile. This check is not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed PR does not add Ginkgo e2e tests. Only refactors tools/import-verifier/import-verifier.go to replace deprecated ioutil with os.ReadFile. SNO check applies only to new Ginkgo tests.
Topology-Aware Scheduling Compatibility ✅ Passed This PR only updates a build-time utility tool's imports, replacing deprecated ioutil.ReadFile with os.ReadFile. No scheduling constraints or manifests changed.
Ote Binary Stdout Contract ✅ Passed Not applicable. The modified file is a standalone CLI utility tool for import validation, not an OTE test binary.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed This PR does not add any Ginkgo e2e tests. It only modernizes imports in a build-time utility tool. The IPv6 and disconnected network test compatibility check is not applicable.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@sebrandon1
Copy link
Copy Markdown
Member Author

/unhold

@openshift-ci openshift-ci Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 4, 2026
@sebrandon1
Copy link
Copy Markdown
Member Author

/retest

@sebrandon1 sebrandon1 force-pushed the ioutil_deprecation branch from 5e5e76f to 66da564 Compare May 13, 2026 21:18
@sebrandon1 sebrandon1 force-pushed the ioutil_deprecation branch from 66da564 to d8a2084 Compare May 18, 2026 20:52
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 18, 2026

@sebrandon1: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-console d8a2084 link true /test e2e-aws-console

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.

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-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants