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

Add YAML model structs for manifest files #194

Merged
merged 3 commits into from
Sep 8, 2023
Merged

Conversation

drevell
Copy link
Contributor

@drevell drevell commented Sep 7, 2023

Part of #191.

These structs will represent the contents of the new "manifest" file, which contains all the information we'll need in the future to cleanly upgrade a template output.

This PR contains custom unmarshaling but not custom marshaling. That will be a separate PR.

Example manifest file:

api_version: 'cli.abcxyz.dev/v1alpha1'
template_location: 'github.com/abcxyz/abc.git//t/rest_server'
template_dirhash: 'h1:5891b5b522d5df086d0ff0b110fbd9d21bb4fc7163af34d08286a2e846f6be03'
inputs:
  - name: 'my_input_1'
    value: 'my_value_1'
  - name: 'my_input_2'
    value: 'my_value_2'
output_hashes:
  - file: 'a/b/c.txt'
    hash: 'h1:b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c'
  - file: 'd/e/f.txt'
    hash: 'h1:7d865e959b2466918c9863afca942d0fb89d7c9ac0c99bafc3749504ded97730'

Some of the field names have been changed since the design doc because the old names seemed unclear.

Part of #191.

These structs will represent the contents of the new "manifest" file,
which contains all the information we'll need in the future to cleanly
upgrade a template output.

This PR contains custom unmarshaling but not custom marshaling. That
will be a separate PR.

Example manifest file:

```
api_version: 'cli.abcxyz.dev/v1alpha1'
template_location: 'github.com/abcxyz/abc.git//t/rest_server'
template_dirhash: 'h1:5891b5b522d5df086d0ff0b110fbd9d21bb4fc7163af34d08286a2e846f6be03'
inputs:
  - name: 'my_input_1'
    value: 'my_value_1'
  - name: 'my_input_2'
    value: 'my_value_2'
output_hashes:
  - file: 'a/b/c.txt'
    hash: 'h1:b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c'
  - file: 'd/e/f.txt'
    hash: 'h1:7d865e959b2466918c9863afca942d0fb89d7c9ac0c99bafc3749504ded97730'
```

Some of the field names have been changed since the design doc because
the old names seemed unclear.
@drevell drevell requested a review from chloechien September 7, 2023 22:27
@drevell drevell requested a review from a team as a code owner September 7, 2023 22:27
@drevell drevell requested a review from sethvargo September 7, 2023 22:27
Copy link
Contributor

@yolocs yolocs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nits

@drevell drevell requested a review from yolocs September 7, 2023 23:00
@drevell drevell enabled auto-merge (squash) September 7, 2023 23:47
@drevell drevell merged commit de35382 into main Sep 8, 2023
@drevell drevell deleted the drevell/manifest-model branch September 8, 2023 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants