From cff32113eb87eec3c011d93f8bb3bdd05b004d95 Mon Sep 17 00:00:00 2001 From: Natik Gadzhi Date: Mon, 30 Sep 2024 15:48:32 -0700 Subject: [PATCH] feat(airbyte-ci): format: pick up .prettierc and .prettierignore (#46274) --- .prettierignore | 9 +++++++++ airbyte-ci/connectors/pipelines/README.md | 1 + .../pipelines/pipelines/airbyte_ci/format/consts.py | 1 + .../pipelines/pipelines/airbyte_ci/format/containers.py | 1 + airbyte-ci/connectors/pipelines/pyproject.toml | 2 +- 5 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.prettierignore b/.prettierignore index 9579ba1a2fc9..bd77e4f5a983 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,3 +1,12 @@ airbyte-integrations/bases/base-normalization/integration_tests/normalization_test_output airbyte-ci/connectors/pipelines/tests/test_changelog/result_files airbyte-integrations/bases/connector-acceptance-test/unit_tests/data/docs + +# Ignore manifest files in manifest-only connectors +# This is done due to prettier being overly opinionated on the formatting of quotes +# Ref: https://github.com/prettier/prettier/issues/973 +# And it not allowing rule opt outs +# Ref: https://github.com/prettier/prettier/discussions/13925 +# Instead we rely on the contribution service to format these files +# See: https://github.com/airbytehq/airbyte/blob/master/CONTRIBUTING.md#adding-a-new-connector +airbyte-integrations/connectors/*/manifest.yaml diff --git a/airbyte-ci/connectors/pipelines/README.md b/airbyte-ci/connectors/pipelines/README.md index ddff1bd7eeea..e520a4e69050 100644 --- a/airbyte-ci/connectors/pipelines/README.md +++ b/airbyte-ci/connectors/pipelines/README.md @@ -851,6 +851,7 @@ airbyte-ci connectors --language=low-code migrate-to-manifest-only | Version | PR | Description | | ------- | ---------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | +| 4.36.1 | | `airbyte-ci format js` respects `.prettierc` and `.prettierignore` | | 4.36.0 | [#44877](https://github.com/airbytehq/airbyte/pull/44877) | Implement `--promote/rollback-release-candidate` in `connectors publish`. | | 4.35.6 | [#45632](https://github.com/airbytehq/airbyte/pull/45632) | Add entry to format file ignore list (`destination-*/expected-spec.json`) | | 4.35.5 | [#45672](https://github.com/airbytehq/airbyte/pull/45672) | Fix docs mount during publish | diff --git a/airbyte-ci/connectors/pipelines/pipelines/airbyte_ci/format/consts.py b/airbyte-ci/connectors/pipelines/pipelines/airbyte_ci/format/consts.py index ddc28e056f25..dda485426b77 100644 --- a/airbyte-ci/connectors/pipelines/pipelines/airbyte_ci/format/consts.py +++ b/airbyte-ci/connectors/pipelines/pipelines/airbyte_ci/format/consts.py @@ -72,4 +72,5 @@ class Formatter(Enum): ], Formatter.PYTHON: ["pyproject.toml", "poetry.lock"], Formatter.LICENSE: [LICENSE_FILE_NAME], + Formatter.JS: [".prettierrc", ".prettierignore"], } diff --git a/airbyte-ci/connectors/pipelines/pipelines/airbyte_ci/format/containers.py b/airbyte-ci/connectors/pipelines/pipelines/airbyte_ci/format/containers.py index fb0651d0c6b3..a3127d5c28cf 100644 --- a/airbyte-ci/connectors/pipelines/pipelines/airbyte_ci/format/containers.py +++ b/airbyte-ci/connectors/pipelines/pipelines/airbyte_ci/format/containers.py @@ -109,6 +109,7 @@ def format_js_container(dagger_client: dagger.Client, js_code: dagger.Directory, return build_container( dagger_client, base_image=NODE_IMAGE, + warmup_dir=warmup_directory(dagger_client, Formatter.JS), dir_to_format=js_code, install_commands=[f"npm install -g npm@10.1.0 prettier@{prettier_version}"], cache_volume=dagger_client.cache_volume(cache_keys.get_prettier_cache_key(prettier_version)), diff --git a/airbyte-ci/connectors/pipelines/pyproject.toml b/airbyte-ci/connectors/pipelines/pyproject.toml index 5ef89228c80c..c5704eceaf01 100644 --- a/airbyte-ci/connectors/pipelines/pyproject.toml +++ b/airbyte-ci/connectors/pipelines/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "pipelines" -version = "4.36.0" +version = "4.36.1" description = "Packaged maintained by the connector operations team to perform CI for connectors' pipelines" authors = ["Airbyte "]