Display warning when reading a buf.lock with a b3 digest#2520
Display warning when reading a buf.lock with a b3 digest#2520oliversun9 merged 13 commits intomainfrom
Conversation
bufdev
left a comment
There was a problem hiding this comment.
The proliferation of loggers here would lead me to think there's a cleaner way to do this, we're adding logger in places we don't want it. Why not just read the lock file at some top level and print a warning if b3 is found, as opposed to weaving this through all the logic? A buflock.CheckDeprecatedDigests function you can call?
bufdev
left a comment
There was a problem hiding this comment.
Yea this looks way better :-) Are you sure these are the only places we need to call it?
I think all commands that read a |
What if we use a global variable to keep track of whether this warning has been printed, so that we only print it once? (or |
Mutable global variables to signal state are banned |
Kind of inclined to say that if you're using |
The point of this is to give people an indication that they should migrate off of b3 digests. How do you think we should do that for repositories using As an alternative to all of this, we could instead show the warning in the BSR UI? It would be visible only to org members/admins. They are more likely to see it anyway, as users aren't in the habit of seeing warnings in CI runs. |
Yeah, I think I'm more in agreeance with that sort of approach, because yeah, exactly, dealing with warnings in a CI run that aren't outright failures are often not priorities. And also, it's something they would need to handle by checking updates into source anyway (same with any dependency upgrade). |
|
We chatted about this, and decided that we're not going to warn from sync, largely because it's highly likely that no one sees those anyway. The high value places to warn are Separately, we will consider a warning in the BSR UI, visible to repository members. |
Right now, if the CLI reads a buf.lock with a b3 digest, it treats digest as empty. This PR displays a warning when it's encountered.
Added a check that reads the lock file and checks whether any digest starts with
b1-orb3-togetSourceModuleConfig, called bybuf beta graph,buf beta price,buf beta stats,buf build,buf convert,buf export,buf format,buf generateandbuf lint, when the source / input is a module directory or workspace directory.runinbuf push.