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

docs: explain default generation config in README.md #3388

Merged
merged 3 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions hermetic_build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,20 @@ for more information.

## Parameters to generate a repository using the docker image

### Generation configuration yaml (`generation-config-path`)
### Generation configuration yaml (`generation-config-path`), optional
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we add a sentence before this section mentioning something like "All the parameters are optional, but a generation_config.yaml is required"?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I added this to Prerequisites.


An absolute or relative path to a configuration file containing parameters to
generate the repository.
Please refer to [Configuration to generate a repository](#configuration-to-generate-a-repository)
for more information.

The default value is `$(pwd)/generation_config.yaml`, i.e., `generation_config.yaml`
in the current working directory.

Raise `FileNotFoundError` if the specified generation config does not exist or,
in the case `generation-config-path` is not specified, the default generation
JoeWang1127 marked this conversation as resolved.
Show resolved Hide resolved
config does not exist.

### Repository path (`repository-path`), optional

The path to where the generated repository goes.
Expand All @@ -41,7 +48,7 @@ For example, `cd google-cloud-java && python /path/to/entry_point.py ...` withou
specifying the `--repository_path` option will modify the `google-cloud-java`
repository the user `cd`'d into.

Note that versions.txt has to exist in `repository_path` in order to generate
Note that `versions.txt` has to exist in `repository_path` in order to generate
right version for each library.
JoeWang1127 marked this conversation as resolved.
Show resolved Hide resolved
Please refer [here](go/java-client-releasing#versionstxt-manifest) for more info
of versions.txt.
Expand Down
26 changes: 8 additions & 18 deletions hermetic_build/library_generation/cli/entry_point.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,28 +78,18 @@ def generate(
api_definitions_path: str,
):
"""
Compare baseline generation config and current generation config and
generate changed libraries based on current generation config.
Generate libraries based on a generation config.

If baseline generation config is not specified but current generation
config is specified, generate all libraries if `library_names` is not
specified, based on current generation config.

If current generation config is not specified but baseline generation
config is specified, raise FileNotFoundError because current generation
config should be the source of truth of library generation.

If both baseline generation config and current generation config are not
specified, generate all libraries based on the default generation config,
which is generation_config.yaml in the current working directory.
If the `generation-config-path` is not specified the default generation
config, `$(pwd)/generation_config.yaml`, will be used.

If `library_names` is specified, only libraries whose name can be found in
the current generation config or default generation config, if current
generation config is not specified, will be generated. Changed libraries
will be ignored even if baseline and current generation config are
specified.
the generation config will be generated; otherwise all libraries in the
generation config will be generated.

Raise FileNotFoundError if the default config does not exist.
:raise FileNotFoundError if the specified generation config does not exist
or, in the case `generation-config-path` is not specified, the default
JoeWang1127 marked this conversation as resolved.
Show resolved Hide resolved
generation config does not exist.
"""
__generate_repo_impl(
generation_config_path=generation_config_path,
Expand Down
Loading