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

Add TiledLogs to log list JSON #1635

Merged
merged 2 commits into from
Jan 9, 2025
Merged

Conversation

mcpherrinm
Copy link
Contributor

This adds the new TiledLog field to the loglist3 JSON.

It does it in what I think is a minimal backwards-compatible fashion, but which results in duplicating most of the Log struct. As this is a fairly "low level" representation of the log JSON, I think that's an appropriate choice.

There's some other options this could take, so I'd like to hear from the maintainers about how they'd like to proceed here.

We could add the new SubmissionURL and Monitoring URL fields to the existing log struct, and one or the other URLs will be set. Users of this code will have to know how to handle an empty URL, which they probably don't do today.

We could pull all the shared fields into a new "BaseLog" struct, which is embedded in both the TiledLog and Log structs. I think this is a decent option, but is a breaking change.

In any of these situations, I'd like to also update the FindLogBy* methods (or add a new version of each) to support both log types, at least for the shared submission paths which are common between both. That'll require some common representation - perhaps an interface with methods that correctly handle the differences. Supporting reading from a tiled log would be great for this package but is definitely beyond the scope of what I intend to accomplish right now.

@mcpherrinm mcpherrinm requested a review from a team as a code owner December 20, 2024 16:25
@mcpherrinm mcpherrinm requested review from mhutchinson and removed request for a team December 20, 2024 16:25
Copy link

google-cla bot commented Dec 20, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@mcpherrinm
Copy link
Contributor Author

force-pushed to change commit email so CLA check passes

@roger2hk roger2hk requested a review from phbnf December 20, 2024 16:48
@roger2hk
Copy link
Contributor

/gcbrun

@mhutchinson mhutchinson requested review from AlCutter and removed request for mhutchinson January 6, 2025 09:51
@phbnf
Copy link
Contributor

phbnf commented Jan 6, 2025

The approach in this PR makes sense to me. Maybe highlight in the TiledLog docstring what the differences are?

Going over the other suggestions:

  • We could add the new SubmissionURL and Monitoring URL fields to the existing log struct: +1 about what you say for the empty URL field. We could arbitrarily chose to put the Submission or Monitoring URL in there, but that would add yet more confusion I think.
  • We could pull all the shared fields into a new "BaseLog" struct, which is embedded in both the TiledLog and Log structs. I think this is a decent option, but is a breaking change.: indeed... I think it's reasonable.

I'd like to also update the FindLogBy* methods (or add a new version of each) to support both log types: I think that adding a new version of the methods is preferable. The FindLogBy* methods return a Log object, so something like FindStaticLogBy* could return a TiledLog. It also matches nicely with the JSON schema. Having two sets of methods is not the most practical thing to use, but I think it's the best path forward for now to avoid breaking older clients, especially clients who use read endpoints, unless you can think of a different way?

@mcpherrinm
Copy link
Contributor Author

OK, so I think we can go with this current approach, and adding new FindLogBy* methods.

I'd rather add those in a follow-up PR than this one, just since I want the new struct in a downstream project :), and will want to think through the FindLogBy* methods a bit, and make sure they work.

I will push another commit adding to the Log / TiledLog structs with some commentary contrasting them

@phbnf
Copy link
Contributor

phbnf commented Jan 9, 2025

/gcbrun

@phbnf phbnf force-pushed the mattm-tiled-logs branch from 900c909 to e8a9c09 Compare January 9, 2025 18:29
@phbnf
Copy link
Contributor

phbnf commented Jan 9, 2025

/gcbrun

@phbnf
Copy link
Contributor

phbnf commented Jan 9, 2025

Thanks Matthew!

@phbnf phbnf merged commit dcb444a into google:master Jan 9, 2025
4 checks passed
@mcpherrinm mcpherrinm deleted the mattm-tiled-logs branch January 10, 2025 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants