-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Upload git info with metadata file (#1) #37802
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
...e-ci/connectors/metadata_service/lib/metadata_service/models/generated/GeneratedFields.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# generated by datamodel-codegen: | ||
# filename: GeneratedFields.yaml | ||
|
||
from __future__ import annotations | ||
|
||
from datetime import datetime | ||
from typing import Optional | ||
|
||
from pydantic import BaseModel, Extra, Field | ||
|
||
|
||
class GitInfo(BaseModel): | ||
class Config: | ||
extra = Extra.forbid | ||
|
||
commit_sha: Optional[str] = Field( | ||
None, | ||
description="The git commit sha of the last commit that modified this file. DO NOT DEFINE THIS FIELD MANUALLY. It will be overwritten by the CI.", | ||
) | ||
commit_timestamp: Optional[datetime] = Field( | ||
None, | ||
description="The git commit timestamp of the last commit that modified this file. DO NOT DEFINE THIS FIELD MANUALLY. It will be overwritten by the CI.", | ||
) | ||
commit_author: Optional[str] = Field( | ||
None, | ||
description="The git commit author of the last commit that modified this file. DO NOT DEFINE THIS FIELD MANUALLY. It will be overwritten by the CI.", | ||
) | ||
commit_author_email: Optional[str] = Field( | ||
None, | ||
description="The git commit author email of the last commit that modified this file. DO NOT DEFINE THIS FIELD MANUALLY. It will be overwritten by the CI.", | ||
) | ||
|
||
|
||
class GeneratedFields(BaseModel): | ||
git: Optional[GitInfo] = None |
31 changes: 31 additions & 0 deletions
31
airbyte-ci/connectors/metadata_service/lib/metadata_service/models/generated/GitInfo.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# generated by datamodel-codegen: | ||
# filename: GitInfo.yaml | ||
|
||
from __future__ import annotations | ||
|
||
from datetime import datetime | ||
from typing import Optional | ||
|
||
from pydantic import BaseModel, Extra, Field | ||
|
||
|
||
class GitInfo(BaseModel): | ||
class Config: | ||
extra = Extra.forbid | ||
|
||
commit_sha: Optional[str] = Field( | ||
None, | ||
description="The git commit sha of the last commit that modified this file. DO NOT DEFINE THIS FIELD MANUALLY. It will be overwritten by the CI.", | ||
) | ||
commit_timestamp: Optional[datetime] = Field( | ||
None, | ||
description="The git commit timestamp of the last commit that modified this file. DO NOT DEFINE THIS FIELD MANUALLY. It will be overwritten by the CI.", | ||
) | ||
commit_author: Optional[str] = Field( | ||
None, | ||
description="The git commit author of the last commit that modified this file. DO NOT DEFINE THIS FIELD MANUALLY. It will be overwritten by the CI.", | ||
) | ||
commit_author_email: Optional[str] = Field( | ||
None, | ||
description="The git commit author email of the last commit that modified this file. DO NOT DEFINE THIS FIELD MANUALLY. It will be overwritten by the CI.", | ||
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -116,3 +116,5 @@ properties: | |
supportsRefreshes: | ||
type: boolean | ||
default: false | ||
generated: | ||
"$ref": GeneratedFields.yaml |
9 changes: 9 additions & 0 deletions
9
airbyte-ci/connectors/metadata_service/lib/metadata_service/models/src/GeneratedFields.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
"$schema": http://json-schema.org/draft-07/schema# | ||
"$id": https://github.com/airbytehq/airbyte/airbyte-ci/connectors_ci/metadata_service/lib/models/src/GeneratedFields.yaml | ||
title: GeneratedFields | ||
description: Optional schema for fields generated at metadata upload time | ||
type: object | ||
properties: | ||
git: | ||
"$ref": GitInfo.yaml |
21 changes: 21 additions & 0 deletions
21
airbyte-ci/connectors/metadata_service/lib/metadata_service/models/src/GitInfo.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
"$schema": http://json-schema.org/draft-07/schema# | ||
"$id": https://github.com/airbytehq/airbyte/airbyte-ci/connectors/metadata_service/lib/metadata_service/models/src/GitInfo.yaml | ||
title: GitInfo | ||
description: Information about the author of the last commit that modified this file | ||
type: object | ||
additionalProperties: false | ||
properties: | ||
commit_sha: | ||
type: string | ||
description: The git commit sha of the last commit that modified this file. DO NOT DEFINE THIS FIELD MANUALLY. It will be overwritten by the CI. | ||
commit_timestamp: | ||
type: string | ||
format: date-time | ||
description: The git commit timestamp of the last commit that modified this file. DO NOT DEFINE THIS FIELD MANUALLY. It will be overwritten by the CI. | ||
commit_author: | ||
type: string | ||
description: The git commit author of the last commit that modified this file. DO NOT DEFINE THIS FIELD MANUALLY. It will be overwritten by the CI. | ||
commit_author_email: | ||
type: string | ||
description: The git commit author email of the last commit that modified this file. DO NOT DEFINE THIS FIELD MANUALLY. It will be overwritten by the CI. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would find it more explicit and maintainable to decouple metadata mutation from metadata upload. Wdyt about create a separate step in publish which would perform this
apply_modifications_to_metadata_file
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm I dont think I like the logic living in the pipeline.
Simply because right now we have metadata logic living already in two places
Currently they are at least contained in the
metadata_service
folderBut if we add the git logic of
Then we end up with 3 locations to look for logic, 1 of which is now outside the area in the codebase