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

inspect: confusion around the message parameter #369

Open
soxofaan opened this issue May 12, 2022 · 4 comments
Open

inspect: confusion around the message parameter #369

soxofaan opened this issue May 12, 2022 · 4 comments
Labels
help wanted Extra attention is needed minor
Milestone

Comments

@soxofaan
Copy link
Member

  • in job logs (GET /jobs/{jobid}/logs) the message field is required and the data field is optional
  • in the proposed inspect process it's currently the other way around: data is required (first) argument and message is optional (even last) argument

I think there is a bit of a mismatch here.

@m-mohr m-mohr self-assigned this May 12, 2022
@m-mohr
Copy link
Member

m-mohr commented Jul 19, 2022

Yes, it's a mismatch but still works. The API only requires a string of any length, so the default value of an empty string is valid (but not very useful).

Some changes we could make:

  1. Make message the second parameter, still optional. Maybe add a different default message such as inspect data or so.
  2. Make message the first parameter, required. Make data the second parameter, optional, with the default value null. In this case, it might be an issue that it's unclear whether data was not given or was null.

As data inspection is the primary use case for this process (I think), I'd slightly tend towards option 1.

@m-mohr m-mohr removed their assignment Jul 19, 2022
@m-mohr m-mohr added the help wanted Extra attention is needed label Jul 19, 2022
@m-mohr m-mohr added this to the 1.3.0 milestone Jul 19, 2022
@soxofaan
Copy link
Member Author

soxofaan commented Aug 2, 2022

As data inspection is the primary use case for this process (I think), I'd slightly tend towards option 1.

I agree. The least we can do is making message the second parameter instead of last.

Changing the default message to something like "inspect data" instead of empty string is also a good idea, to avoid empty entries in simple log views

@m-mohr
Copy link
Member

m-mohr commented Aug 2, 2022

message is now the second parameter.

I'm not sure about the default message yet. Having it might actually be annoying if you log a lot.

@m-mohr m-mohr modified the milestones: 1.3.0, future Aug 2, 2022
@m-mohr m-mohr changed the title inspect vs job logs inspect: confusion around the message parameter Aug 2, 2022
@soxofaan
Copy link
Member Author

soxofaan commented Aug 3, 2022

Having it might actually be annoying if you log a lot.

I think a minimal message is better than an empty string (especially if you have a compact log widget that only shows the message). It is a required field under GET /jobs/{jobid}/logs, so an empty string is a bit of lame workaround.

And if users find it annoying: that's an incentive to write a more descriptive one 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed minor
Projects
None yet
Development

No branches or pull requests

2 participants