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

ENG-8624 fix operating_system_version/operating_system mismatch #275

Merged
merged 1 commit into from
Dec 4, 2020

Conversation

kqdeng
Copy link
Contributor

@kqdeng kqdeng commented Aug 31, 2020

Signed-off-by: Kelly Deng [email protected]

Description

This PR fixes the mismatch in field names operating_system_version vs operating_system.

Why is this needed

This bug mainly affects the users who needs both the packet.pb.go and the EC2 endpoint. Because the EC2 endpoint in Hegel uses the field name operating_system to be backwards compatible with Kant, users using the Metadata object defined in packet.pb.go will face a problem with parsing the operating system field since it was defined as operating_system_version there.
The reason for the mismatch is because in the "old" cacher mode, operating_system_version, but Kant uses operating_system (which we have to be backwards compatible with) so we decided move away from operating_system_version and go with operating_system for "tink mode".
A user could have worked around this by specifying two fields operating_system and operating_system_version with the same value, inside the same piece of hardware, but this introduces some redundancy and just isn't ideal.

Related PR: tinkerbell/smee#104

Fixes: #

How Has This Been Tested?

To be manually tested

How are existing users impacted? What migration steps/scripts do we need?

Existing users who import the packet.pb.go will have to go get latest master of the tink repo.

Checklist:

I have:

  • updated the documentation and/or roadmap (if required)
  • added unit or e2e tests
  • provided instructions on how to upgrade

@codecov
Copy link

codecov bot commented Aug 31, 2020

Codecov Report

Merging #275 (df9951b) into master (86057d3) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #275   +/-   ##
=======================================
  Coverage   24.74%   24.74%           
=======================================
  Files          14       14           
  Lines        1277     1277           
=======================================
  Hits          316      316           
  Misses        940      940           
  Partials       21       21           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 86057d3...df9951b. Read the comment docs.

@gianarb
Copy link
Contributor

gianarb commented Aug 31, 2020

Is this a bc break? How does it impact users? Can we add a bit more context to this pull request in the description?
Thanks

@displague
Copy link
Member

@kdeng3849 Can you rebase this and update with the latest protos/protoc.sh (presumably this should result in a smaller diff, especially if the containerized protoc is used).

To @gianarb's point, can we offer both operating_system and operating_system_version to avoid a BC break? Does this make sense in the long-run? (operating_system=debian, operating_system_version=9.0)

@kqdeng kqdeng force-pushed the ENG-8624-os-field-mismatch branch from 1cb7f3c to 9acbde3 Compare October 14, 2020 22:06
@kqdeng
Copy link
Contributor Author

kqdeng commented Oct 14, 2020

@displague I'm not sure if that makes sense because the operating_system/operating_system_version field is actually an object (not string and float, unless I misunderstood you there).

I guess we could offer both for backward compatibility, but I don't think many people were using the code generated from the packet proto to begin with? And I also think operating_system makes more sense compared to operating_system_version since with version in the name people might think it's actually referring to a version number, when it's not. Just feels unintuitive to me.

@kqdeng kqdeng force-pushed the ENG-8624-os-field-mismatch branch from 9acbde3 to f80766b Compare November 16, 2020 14:53
@mmlb
Copy link
Contributor

mmlb commented Nov 16, 2020

This isn't really a bc-break as packet.proto is not supported in the oss project. Its being used by one internal client that is currently broken and needs this PR so it works. Either way, packet.proto should be replaced and actually be usable by tinkerbell/proposals#25

mmlb
mmlb previously approved these changes Dec 1, 2020
@mmlb mmlb force-pushed the ENG-8624-os-field-mismatch branch from f80766b to 6ce4660 Compare December 1, 2020 23:09
@mmlb mmlb added the ready-to-merge Signal to Mergify to merge the PR. label Dec 1, 2020
mergify bot added a commit to tinkerbell/smee that referenced this pull request Dec 2, 2020
## Description

<!--- Please describe what this PR is going to change -->
This PR fixes the mismatch in field names [`operating_system_version`](https://github.com/tinkerbell/tink/blob/master/protos/packet/packet.proto#L86) vs [`operating_system`](https://github.com/tinkerbell/hegel/blob/a3138d417536903dcdedd674d634e13ebc19fc79/http_handlers.go#L33).

v2 of #104

## Why is this needed
This bug mainly affects the users who needs both the `packet.pb.go` and the EC2 endpoint. Because the EC2 endpoint in Hegel uses the field name `operating_system` to be backwards compatible with Kant, users using the `Metadata` object defined in `packet.pb.go` will face a problem with parsing the operating system field since it was defined as `operating_system_version` there. 
The reason for the mismatch is because in the "old" cacher mode, `operating_system_version`, but Kant uses `operating_system` (which we have to be backwards compatible with) so we decided move away from `operating_system_version` and go with `operating_system` for "tink mode".
A user could have worked around this by specifying two fields `operating_system` and `operating_system_version` with the same value, inside the same piece of hardware, but this introduces some redundancy and just isn't ideal.

<!--- Link to issue you have raised -->

Related PR: tinkerbell/tink#275


## How Has This Been Tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran to -->
<!--- see how your change affects other areas of the code, etc. -->

Manually tested

## How are existing users impacted? What migration steps/scripts do we need?

<!--- Fixes a bug, unblocks installation, removes a component of the stack etc -->
<!--- Requires a DB migration script, etc. -->

N/A

## Checklist:

I have:

- [ ] updated the documentation and/or roadmap (if required)
- [ ] added unit or e2e tests
- [ ] provided instructions on how to upgrade
@mmlb mmlb self-requested a review December 4, 2020 21:40
mmlb
mmlb previously approved these changes Dec 4, 2020
@kqdeng kqdeng force-pushed the ENG-8624-os-field-mismatch branch from 05b8b92 to df9951b Compare December 4, 2020 21:44
@kqdeng kqdeng requested a review from mmlb December 4, 2020 22:28
@mergify mergify bot merged commit fe762e8 into tinkerbell:master Dec 4, 2020
@mmlb mmlb removed the ready-to-merge Signal to Mergify to merge the PR. label Jan 25, 2021
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.

4 participants