-
Notifications
You must be signed in to change notification settings - Fork 106
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
Unify naming, improve readability and code correctness #193
Comments
I agree. Thanks for writing this up! Enums over strings seems like a no-brainer to me, so no further comments on that. Naming:
|
Here is an example from a design document I put together last year. This example shows how we could present the hierarchy of a compose, and all the images/jobs created from that compose, and then the uploads per image. After doing a few rounds of reviews, the terminology I ended up using is the following. But please let me know if you have suggestions.
|
These two answers seems to be in contradiction, right?
2.
My formal proposal (I think we could include it in the README once we agree on it) Compose
Image build(I'm using the terminology from @jgiardino so feel free to disagree @teg )
Image format
Upload action
Proposed code change: - func (s *Store) PushCompose(composeID uuid.UUID, bp *blueprint.Blueprint, checksums map[string]string, arch, composeType string, uploadTarget *target.Target) error {
+ func (s *Store) PushCompose(composeID uuid.UUID, bp *blueprint.Blueprint, checksums map[string]string, arch, imageFormats []ImageFormat, uploadTarget *target.Target) error { where |
|
I agree with Jenn, image type is imho more suitable than image format - the example with qcow2 s great. |
Right, we distinguish between pending "build" and a running one, which we call a "job".
You are right, so we should use "image type" in the API I mention above. But we might want to reconsider naming of the types we use now because, as you mention, we use: ami, qcow2, openstack, vhd, etc. but what we really implement is: AWS image, generic qcow2, OpenStack image, Azure image. |
Edited version from my comment above ^^^My formal proposal (I think we could include it in the README once we agree on it) Compose
Image build
Image type
Upload action
Do we want to replace the variable name "output" and use "image" instead? In this context we might want to use "types" or something like that to better reflect the newly proposed terminology. |
I think that's a good idea. Unfortunately, I'm a bit afraid of backwards compatibility. I think cockpit-composer checks for available image types but the API tests have hardcoded values. |
Yes, and no. Under normal circumstances, I would now challenge Jenn to a round of jousting, but I think we may actually want both things: I agree with all the definitions from Martin's last comment, but I would also add: Job
This concept would not appear in the UI though, composer would take the |
Yes, I like keeping both image build and job as defined in the previous comments. Even so, I would still be down for a team outing to an renaissance faire next week. |
I think most of these issues have been addressed so I'm closing this now. Follow up issue is: #200 |
Inconsistent naming
The current implementation refers to the same variable with 3 different names:
composeType
osbuild-composer/internal/store/store.go
Line 446 in 02a194f
OutputType
osbuild-composer/internal/store/store.go
Line 475 in 02a194f
outputFormat
osbuild-composer/internal/distro/distro.go
Line 37 in 02a194f
Undefined terminology
We should start using "type" or "format" consistently across the codebase and also define our terminology, preferably in some guide for contributors:
Weak typing
Also I would prefer to use enumeration for architectures and compose types instead of a string which is error prone. For example:
The text was updated successfully, but these errors were encountered: