-
Notifications
You must be signed in to change notification settings - Fork 170
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
Move the schema/ package to the toplevel #3069
Conversation
Skipping CI for Draft Pull Request. |
b2c59d0
to
169772c
Compare
70af286
to
dbd5ad7
Compare
One way to look at this is if it'd merged before #2985 the number of files changed there would have been closer to 4, not 400+. The 400+ files removed here are the (re-)vendored dependencies there. |
OK cool, passing FCOS/Jenkins CI now, I'd assume RHCOS will pass too. Should be good to review |
dbd5ad7
to
6f26716
Compare
/retest |
A few things.
|
The "schema" package before also had code to parse |
Not to my knowledge, but certainly as we make the transition more into being a Go project, we should think about this. It's worth looking at https://github.com/golang-standards/project-layout However actually, because mantle is a separate Go module, even though it lives in the same git repository we need to make packages it uses public - for now. |
Perhaps |
It's as good as any I can think of. Maybe we can get input from others? Side note: I'm not going to lie, the word |
Right...there's always more cleanup to do. As a baseline I tend to ask "is this PR making things objectively better?" And if so then I prefer merging and doing followup changes, especially from people I know are likely to stick around to do those changes. Actually even for drive by contributors, merging slightly-less-than-perfect changes helps avoid the case where they're pulled away by life events or whatever and the PR doesn't get merged at all (or not for a while). |
6f26716
to
29af1ae
Compare
OK renamed to |
@@ -31,7 +31,7 @@ import ( | |||
"github.com/pkg/errors" | |||
"github.com/spf13/cobra" | |||
|
|||
"github.com/coreos/coreos-assembler-schema/cosa" | |||
cosa "github.com/coreos/coreos-assembler/pkg/builds" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
random aside: I'm wondering if we should not rename the import here.. not sure. I'm definitely don't have this all in my head.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a matter of taste; I chose not to here to avoid inflating the diff more. Probably in most code we wouldn't rename it though.
there is a |
nvm - there's a bunch of them. Something new for me to learn I guess. Any go experts want to review this PR along with me? |
29af1ae
to
6a89503
Compare
Oops definitely not, it was apparently a misfired |
d76f3eb
to
8d35527
Compare
While it's not related to this PR in a logical sense, I pushed an additional commit here which should fix |
Is the |
We did; see https://github.com/coreos/coreos-assembler/blob/main/src/v1.json What changes in this PR is we no longer have two separate copies. |
Ahh. Yep. The diff view here in GH didn't make that obvious.
It's great that we now don't have two separate copies, but I am worried this is going to break a common COSA workflow where someone sets the |
With the move to Go, that workflow will slowly become obsolete and break. Eventually I think what we want is that literally all of the logic lives in But specifically regarding the schema, even before this PR that problem already existed because you couldn't modify it and still invoke e.g. |
which is the use case that I'd say until we get a better strategy for how we support that use case in the future maybe let's just make the schema generation |
Today, we have *three* Go modules in this repository: - / - schema/ - mantle/ And as of recently, both the toplevel / and mantle/ vendor the schema/. This causes "vendor amplification", where a vendored dependency of schema/ gets *triplicated*. Now that gangplank/ is out of the picture, it makes sense to move the bits from schema/ into the toplevel module. This really helps make operating on coreos-assembler stuff feel like a "first class" operation. Also, we no longer have two copies of the schema file!
A perfect example of the enormous technical debt we've accrued in the python/shell/Go duplication, not to mention separate Go modules for mantle and gangplank. The gangplank code reimplemented logic to get the RPM architecture, and missed converting `arm64` from Go's arch to `aarch64`. Use the standard API we have for this in stream-metadata-go, the same as mantle does. This will fix extensions builds on aarch64.
8d35527
to
c5f25ec
Compare
Sure, done - that actually makes the install logic simpler. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
The future is now ➡️ #3087 |
Fixes: coreos#3069 I am pretty sure I had this working in some point in that PR, but in reworking for feedback I broke having `make schema` actually work. Put the target files in the right place, and fix the namespace.
Fixes: #3069 I am pretty sure I had this working in some point in that PR, but in reworking for feedback I broke having `make schema` actually work. Put the target files in the right place, and fix the namespace.
Today, we have three Go modules in this repository:
And as of recently, both the toplevel / and mantle/ vendor the schema/.
This causes "vendor amplification", where a vendored dependency
of schema/ gets triplicated.
Now that gangplank/ is out of the picture, it makes sense to move
the bits from schema/ into the toplevel module.
This really helps make operating on coreos-assembler stuff
feel like a "first class" operation.
Also, we no longer have two copies of the schema file!