diff --git a/.github/workflows/deploy_docs.yaml b/.github/workflows/deploy_docs.yaml index 0f703e2..1924aaf 100644 --- a/.github/workflows/deploy_docs.yaml +++ b/.github/workflows/deploy_docs.yaml @@ -1,9 +1,10 @@ name: Deploy doc to GitHub Pages on: - push: - branches: - - 'main' + release: + types: + - published + workflow_dispatch: env: python-version: "3.10" diff --git a/deployer/utils/models.py b/deployer/utils/models.py index 13f22f0..1838585 100644 --- a/deployer/utils/models.py +++ b/deployer/utils/models.py @@ -1,4 +1,4 @@ -from inspect import signature +from inspect import Parameter, signature from typing import Callable, Literal, Optional, Protocol from pydantic import BaseModel, ConfigDict, create_model @@ -44,13 +44,18 @@ def create_model_from_func( func_signature = signature(func) + func_typing = { + p.name: ( + type_converter(p.annotation), + ... if (exclude_defaults or p.default == Parameter.empty) else p.default, + ) + for p in func_signature.parameters.values() + } + func_model = create_model( __model_name=model_name, __base__=CustomBaseModel, - **{ - p.name: (type_converter(p.annotation), ... if exclude_defaults else p.default) - for p in func_signature.parameters.values() - }, + **func_typing, ) return func_model diff --git a/deployer/utils/utils.py b/deployer/utils/utils.py index 1bd6cc7..968757e 100644 --- a/deployer/utils/utils.py +++ b/deployer/utils/utils.py @@ -316,7 +316,7 @@ def _parse_validation_errors( else: config_name = error["loc"][3] error_row = {"type": error["type"], "msg": error["msg"]} - parsed_errors[pipeline_name][config_name] = [] + parsed_errors[pipeline_name].setdefault(config_name, []) if len(error["loc"]) > 4: error_row["field"] = error["loc"][5] parsed_errors[pipeline_name][config_name].append(error_row) diff --git a/docs/CLI_REFERENCE.md b/docs/CLI_REFERENCE.md index ceb88ec..79c0cce 100644 --- a/docs/CLI_REFERENCE.md +++ b/docs/CLI_REFERENCE.md @@ -52,6 +52,7 @@ $ vertex-deployer check [OPTIONS] PIPELINE_NAMES... * `PIPELINE_NAMES...`: The names of the pipeline to create. [optional] **Options**: + * `--all, -a / --no-all`: Whether to check all pipelines. [default: no-all] * `--config-filepath, -cfp PATH`: Path to the json/py file with parameter values and input artifacts to check. If not specified, all config files in the pipeline dir will be checked. * `--warn-defaults, -wd / --no-warn-defaults, -nwd`: Whether to warn when a default value is used and not overwritten in config file. [default: warn-defaults] diff --git a/templates/.release_notes.md.j2 b/templates/.release_notes.md.j2 new file mode 100644 index 0000000..243bf0b --- /dev/null +++ b/templates/.release_notes.md.j2 @@ -0,0 +1,9 @@ +## {{ version.as_tag() }} ({{ release.tagged_date.strftime("%Y-%m-%d") }}) +{% for type_, commits in release["elements"] | dictsort %} +{% if type_ == "enh" %} +### {{ "Enhancements" | capitalize }} +{% else %} +### {{ type_ | capitalize }} +{% endif %}{%- if type_ != "unknown" %}{% for commit in commits %} +* {{ commit.descriptions[0] }} by {{commit.commit.author.name}} in [`{{ commit.short_hash }}`]({{ commit.hexsha | commit_hash_url }}) +{%- endfor %}{% endif %}{% endfor %}