Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

history: inspect json and go template format #2964

Merged
merged 7 commits into from
Feb 11, 2025

Conversation

crazy-max
Copy link
Member

No description provided.

@crazy-max crazy-max added this to the v0.21.0 milestone Feb 3, 2025
@crazy-max crazy-max force-pushed the history-inspect-json branch from 30442f6 to dc65c53 Compare February 3, 2025 13:53
@crazy-max crazy-max requested a review from tonistiigi February 3, 2025 17:44
@crazy-max crazy-max marked this pull request as ready for review February 3, 2025 17:44
@tonistiigi
Copy link
Member

https://github.com/docker/buildx/compare/master...tonistiigi:buildx:history-inspect-format?expand=1 is my wip for adding format. Main difference is that there is a new struct for history inspection instead of raw HistoryRecord with other (random) values. That struct can be formatted and provides similar output to the default text (that also now comes from printing the struct).

I think this is preferred. If lgty you may finish that instead.

@crazy-max
Copy link
Member Author

https://github.com/docker/buildx/compare/master...tonistiigi:buildx:history-inspect-format?expand=1 is my wip for adding format. Main difference is that there is a new struct for history inspection instead of raw HistoryRecord with other (random) values. That struct can be formatted and provides similar output to the default text (that also now comes from printing the struct).

I think this is preferred. If lgty you may finish that instead.

Yes looks good to me, I carry over your changes and keep you posted.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
@crazy-max
Copy link
Member Author

Yes looks good to me, I carry over your changes and keep you posted.

It doesn't return build name and error logs which is needed for GHA summary:

I will make some changes to handle that

crazy-max and others added 2 commits February 6, 2025 16:12
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
@crazy-max crazy-max force-pushed the history-inspect-json branch from dc65c53 to ccca7c7 Compare February 6, 2025 15:26
@crazy-max
Copy link
Member Author

crazy-max commented Feb 6, 2025

@tonistiigi Updated on top of your branch.

Steps counts were missing in out and also added build name and error logs that are needed for GHA summary. I didn't add error sources but I think we could. Should probably be base64 encoded?

Also missing materials and attachments. I guess we would want this in out.config?

Edit: added error sources

@crazy-max crazy-max force-pushed the history-inspect-json branch from c7217c1 to d25bb03 Compare February 6, 2025 16:49
commands/history/inspect.go Outdated Show resolved Hide resolved
commands/history/inspect.go Outdated Show resolved Hide resolved
commands/history/inspect.go Outdated Show resolved Hide resolved
commands/history/inspect.go Outdated Show resolved Hide resolved
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
@crazy-max crazy-max force-pushed the history-inspect-json branch from d25bb03 to f15eaa1 Compare February 7, 2025 10:38
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
@crazy-max crazy-max force-pushed the history-inspect-json branch from f15eaa1 to 417af36 Compare February 7, 2025 11:09
@crazy-max crazy-max requested a review from tonistiigi February 7, 2025 11:10
@crazy-max crazy-max changed the title history: inspect json format history: inspect json and go template format Feb 7, 2025
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
@tonistiigi
Copy link
Member

JSON should be usable as function as well like {{json .}}

@tonistiigi tonistiigi merged commit c8c9c72 into docker:master Feb 11, 2025
129 checks passed
@crazy-max crazy-max deleted the history-inspect-json branch February 11, 2025 00:31
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.

2 participants