Skip to content

Refactor checks output writing to a dedicated utility with robust I/O and error handling #4606

@iihimanshuu

Description

@iihimanshuu

What feature do you want to see added?

ArtifactoryPermissionsUpdater.reportChecksApiDetails writes to checks-title.txt and checks-details.txt directly and is marked with a TODO noting it’s odd in a standalone tool. Replace this ad‑hoc file writing with a small utility that:

  • Uses NIO (Files.newBufferedWriter/Files.writeString) with explicit charset and atomic write.
  • Allows an output directory to be configured (system property or env), with sensible defaults.
  • Handles and logs I/O errors gracefully, returning success/failure.
  • Is unit-tested.

Files to modify/add:

  • src/main/groovy/io/jenkins/infra/repository_permissions_updater/ArtifactoryPermissionsUpdater.groovy
  • New: src/main/java/io/jenkins/infra/repository_permissions_updater/ChecksOutput.java (or ChecksOutput.groovy)

Upstream changes

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions