Skip to content

metadata-service[lib]: change metadata upload logic for release candidates #44509

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

Conversation

alafanechere
Copy link
Contributor

@alafanechere alafanechere commented Aug 21, 2024

What

Relates to https://github.com/airbytehq/airbyte-internal-issues/issues/9403

When a connector metadata is flagged as a release candidate we should upload it to a dedicated path in GCS, so that it will not be picked up by the registry as the latest version.

Copy link

vercel bot commented Aug 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
airbyte-docs ⬜️ Ignored (Inspect) Visit Preview Aug 22, 2024 4:10pm

Copy link
Contributor Author

alafanechere commented Aug 21, 2024

@alafanechere alafanechere changed the title metadata-service[orchestrator]: change metadata upload logic for release candidates metadata-service[lib]: change metadata upload logic for release candidates Aug 21, 2024
@alafanechere alafanechere force-pushed the augustin/08-21-metadata-service_lib_introduce_the_Rollout_field_to_metadata_model branch from bbdcb0a to ba31fd5 Compare August 21, 2024 16:13
@alafanechere alafanechere force-pushed the augustin/08-21-metadata-service_orchestrator_change_metadata_upload_logic_for_release_candidates branch from fb3fc3b to 80de6c1 Compare August 21, 2024 16:13
@alafanechere alafanechere marked this pull request as ready for review August 21, 2024 16:16
@alafanechere alafanechere requested a review from a team August 21, 2024 16:16
@alafanechere alafanechere force-pushed the augustin/08-21-metadata-service_lib_introduce_the_Rollout_field_to_metadata_model branch from ba31fd5 to 3ccc18d Compare August 21, 2024 16:20
@alafanechere alafanechere force-pushed the augustin/08-21-metadata-service_orchestrator_change_metadata_upload_logic_for_release_candidates branch from 80de6c1 to d6a6a60 Compare August 21, 2024 16:21
@alafanechere alafanechere force-pushed the augustin/08-21-metadata-service_lib_introduce_the_Rollout_field_to_metadata_model branch from 3ccc18d to c678426 Compare August 21, 2024 16:24
@alafanechere alafanechere force-pushed the augustin/08-21-metadata-service_orchestrator_change_metadata_upload_logic_for_release_candidates branch from d6a6a60 to 2bbf721 Compare August 21, 2024 16:25
Copy link
Contributor

@clnoll clnoll left a comment

Choose a reason for hiding this comment

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

Approved with a couple of minor requests.

I'm not too familiar with the publishing pipeline. Since there are no unit tests, have you tested these changes manually?

@@ -144,6 +144,10 @@ def _latest_upload(metadata: ConnectorMetadataDefinitionV0, bucket: storage.buck
latest_path = get_metadata_remote_file_path(metadata.data.dockerRepository, "latest")
return upload_file_if_changed(metadata_file_path, bucket, latest_path, disable_cache=True)

def _release_candidate_upload(metadata: ConnectorMetadataDefinitionV0, bucket: storage.bucket.Bucket, metadata_file_path: Path) -> Tuple[bool, str]:
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks almost identical to _latest_upload on line 143. Should we move "release_candidate" (and "latest", from line 144) to constants, and then have just a helper function _upload that takes it in as a variable, instead of two helper functions?

Comment on lines 308 to 309
is_pre_release = validator_opts.prerelease_tag is not None
is_release_candidate = metadata.data.release.is_release_candidate
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it worth adding an assertion that is_pre_release and is_release_candidate aren't both True?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Both can be True. It's determined as a pre-release from options passed to the metadata upload CLI (which originally come from an airbyte-ci connectors publish inputs.
So nothing prevents you from having is_release_candidate set to True, but wanting to release a pre-release for testing (usually from your branch).
This is why I added should_upload_release_candidate and should_upload_latest which would both be falsy if the it's a pre-release.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah okay that makes sense to me. Thanks for clarifying.

# - the current metadata to the "latest" path
# - the current doc to the "latest" path
# - the current inapp doc to the "latest" path
if should_upload_latest:
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we'll eventually want to move this logic into a helper function so it can be accessed by the final part of the RC publishing pipeline. But all good if you want to leave it here for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I envision the "final part of the RC publishing pipeline" to be orchestrated via an airbyte-ci command which would:

  • Delete the release_candidate/metadata.yaml file (could be done in this package)
  • Set the isReleaseCandidate field to false in metadata.yaml (could be done in this package)
  • Push the current version with the latest (will likely be done directly in airbyte-ci)

So I don't think a change here is required: the update of the metadata.yaml isReleaseCandidate field will change the behavior of the upload function

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay cool, that sounds good.

@octavia-squidington-iv octavia-squidington-iv requested a review from a team August 22, 2024 10:44
@alafanechere alafanechere force-pushed the augustin/08-21-metadata-service_lib_introduce_the_Rollout_field_to_metadata_model branch from c678426 to 46977fc Compare August 22, 2024 12:25
@alafanechere alafanechere force-pushed the augustin/08-21-metadata-service_orchestrator_change_metadata_upload_logic_for_release_candidates branch from 2bbf721 to 1e0f886 Compare August 22, 2024 12:25
@alafanechere alafanechere force-pushed the augustin/08-21-metadata-service_lib_introduce_the_Rollout_field_to_metadata_model branch from 46977fc to c088c5b Compare August 22, 2024 13:17
@alafanechere alafanechere force-pushed the augustin/08-21-metadata-service_orchestrator_change_metadata_upload_logic_for_release_candidates branch from 1e0f886 to 712ff3f Compare August 22, 2024 13:17
# - the current metadata to the "latest" path
# - the current doc to the "latest" path
# - the current inapp doc to the "latest" path
if should_upload_latest:
Copy link
Contributor

Choose a reason for hiding this comment

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

Okay cool, that sounds good.

Copy link
Contributor Author

alafanechere commented Aug 22, 2024

Merge activity

  • Aug 22, 12:07 PM EDT: @alafanechere started a stack merge that includes this pull request via Graphite.
  • Aug 22, 12:10 PM EDT: Graphite rebased this pull request as part of a merge.
  • Aug 22, 12:19 PM EDT: @alafanechere merged this pull request with Graphite.

@alafanechere alafanechere changed the base branch from augustin/08-21-metadata-service_lib_introduce_the_Rollout_field_to_metadata_model to graphite-base/44509 August 22, 2024 16:07
@alafanechere alafanechere changed the base branch from graphite-base/44509 to master August 22, 2024 16:08
@alafanechere alafanechere force-pushed the augustin/08-21-metadata-service_orchestrator_change_metadata_upload_logic_for_release_candidates branch from 712ff3f to 63e2cfd Compare August 22, 2024 16:09
@alafanechere alafanechere merged commit 41fb665 into master Aug 22, 2024
30 checks passed
@alafanechere alafanechere deleted the augustin/08-21-metadata-service_orchestrator_change_metadata_upload_logic_for_release_candidates branch August 22, 2024 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants