Skip to content

Conversation

Honny1
Copy link
Member

@Honny1 Honny1 commented Oct 10, 2025

Add custom JSON methods to PruneReport to handle error field marshalling.

Fixes: #27267

Does this PR introduce a user-facing change?

None

@openshift-ci openshift-ci bot added release-note-none do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Oct 10, 2025
@Honny1 Honny1 force-pushed the fix-unmarshal-prunereport branch from 21c5ded to 6d77200 Compare October 10, 2025 13:13
Copy link

[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore.

@Honny1 Honny1 marked this pull request as ready for review October 10, 2025 14:07
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 10, 2025
@Honny1
Copy link
Member Author

Honny1 commented Oct 13, 2025

/packit retest-failed

Copy link
Collaborator

@ninja-quokka ninja-quokka left a comment

Choose a reason for hiding this comment

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

/LGTM

thanks @Honny1, looks great to me, nice and clean :)

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Oct 13, 2025
Copy link
Contributor

openshift-ci bot commented Oct 13, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Honny1, ninja-quokka
Once this PR has been reviewed and has the lgtm label, please assign tomsweeneyredhat for approval. For more information see the Code Review Process.

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

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

return &APIResponse{Response: response}
}

Describe("when processing SystemPruneReport", func() {
Copy link
Member

Choose a reason for hiding this comment

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

This and the Context bit underneath are unnecessary, remove them.

@@ -0,0 +1,86 @@
package bindings
Copy link
Member

Choose a reason for hiding this comment

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

This needs to be in the pkg/bindings/test subdir

Size uint64 `json:"Size"`
}

type pruneReportHelper struct {
Copy link
Member

Choose a reason for hiding this comment

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

Why is this necessary?

Copy link
Member Author

Choose a reason for hiding this comment

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

Since the encoding/json package doesn't know how to marshal and unmarshal error types, it translates them into strings. I'm not sure if a better implementation exists in Go

@@ -0,0 +1,87 @@
package reports
Copy link
Member

Choose a reason for hiding this comment

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

Are we actually running unit tests from this directory? I don't see any others in the directory.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure if we're running this. Can I remove it, and we just rely on the bindings test instead?

Add custom JSON methods to PruneReport to handle error field marshalling.

Fixes: containers#27267

Signed-off-by: Jan Rodák <[email protected]>
@Honny1 Honny1 force-pushed the fix-unmarshal-prunereport branch from 6d77200 to 56fee79 Compare October 14, 2025 12:33
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Oct 14, 2025
Copy link
Contributor

openshift-ci bot commented Oct 14, 2025

New changes are detected. LGTM label has been removed.

@Honny1
Copy link
Member Author

Honny1 commented Oct 14, 2025

@mheon I have moved the test into the correct directory and removed the Context. Please let me know if I should remove pkg/domain/entities/reports/prune_test.go as well.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[It] podman system prune --build clean up after terminated build: test flaky

3 participants