Conversation
alexrashed
left a comment
There was a problem hiding this comment.
LGTM! I added a few questions and nitpicks, but nothing blocking ;)
bin/update_aws_spec.py
Outdated
| in a file at a given path. | ||
| """ | ||
| version = "latest" if latest else ls_version | ||
| openapi_path = Path(os.path.dirname(__file__)) / ".." / "openapi" / "emulators"/ f"localstack-spec-{version}.yml" |
There was a problem hiding this comment.
Q: What is the motivation behind adding the version to the filename? I feel like the version field in the spec together with tags and releases should be enough, and with different file names diffing just gets more complicated... I would love to be able to see the differences between two versions of the specs just by looking at the changes in the commits. :)
There was a problem hiding this comment.
My initial idea was to keep here all the tagged specs plus a latest. But since the specs are actually attached to the release, I do agree that this is redundant.
| @click.command() | ||
| @click.option('--latest', is_flag=True, default=False, help='If enabled, sets the version of the spec to latest.') |
There was a problem hiding this comment.
nit: I'm not sure if it's necessary to add a dependency on click just to add an argument, but that's just a very subjective opinion and click is pretty cool :P
There was a problem hiding this comment.
As you correctly mentioned above, click comes transitively with LocalStack so I don't see harm using it :)
This PR improves the python script we use to generate an update version of the spec.
Initially, the script was:
get_localstack_openapi_specfunction from LocalStack core to retrieve the entire spec;latest;openapi/emulators/localstack-spec-latest.yml).The script now take as
--latestflag to replicate the behavior described above.If the flag is not provided, the version number is exactraced from LocalStack itself. This give us some flexibility to use the same script in the release pipeline.
Context: the step to publish a tagged spec at release time uses the improved version of the script in this PR.