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

🎉 Source Github: rename field mergeable to is_mergeable #14274

Merged
merged 8 commits into from
Jun 30, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
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
2 changes: 1 addition & 1 deletion airbyte-integrations/connectors/source-github/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ RUN pip install .
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]

LABEL io.airbyte.version=0.2.38
LABEL io.airbyte.version=0.2.39
LABEL io.airbyte.name=airbyte/source-github
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"merged": {
"type": ["null", "boolean"]
},
"mergeable": {
"_mergeable": {
"type": ["null", "string"]
},
"can_be_rebased": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,9 @@ def parse_response(self, response: requests.Response, **kwargs) -> Iterable[Mapp
record["repository"] = self._get_name(repository)
if record["merged_by"]:
record["merged_by"]["type"] = record["merged_by"].pop("__typename")
# to avoid conflict with old field 'mergeable' of type 'boolean' in REST API
if "mergeable" in record:
Copy link
Contributor

Choose a reason for hiding this comment

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

@grubberr how did this conflict happen? did Github make a backwards breaking change in their API suddenly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This happened because switching from REST API -> GraphQL API for this stream pull_request_stats. It looks like Github provide more extended values for this field mergeable in GraphQL API.

I provide you schema change for convenience:

OLD REST API SCHEMA

Type Name possible values
boolean mergeable false, null
boolean rebaseable false, null
string mergeable_state "dirty", "unknown"

NEW GRAPHQL SCHEMA:

Type Name possible values
string mergeable "CONFLICTING", "MERGEABLE", "UNKNOWN"
boolean can_be_rebased true, false
string merge_state_status "BLOCKED", "DIRTY", "UNKNOWN", "UNSTABLE"

Copy link
Collaborator

@bazarnov bazarnov Jun 30, 2022

Choose a reason for hiding this comment

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

"is_mergable" will be better naming.
LGTM.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bazarnov changed

record["_mergeable"] = record.pop("mergeable")
yield record

def next_page_token(self, response: requests.Response) -> Optional[Mapping[str, Any]]:
Expand Down
1 change: 1 addition & 0 deletions docs/integrations/sources/github.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ The GitHub connector should not run into GitHub API limitations under normal usa

| Version | Date | Pull Request | Subject |
|:--------|:-----------| :--- |:-------------------------------------------------------------------------------------------------------------|
| 0.2.39 | 2022-06-30 | [14274](https://github.com/airbytehq/airbyte/pull/14274) | Rename field `mergeable` to `_mergeable` |
| 0.2.38 | 2022-06-27 | [13989](https://github.com/airbytehq/airbyte/pull/13989) | Use GraphQL for `reviews` stream |
| 0.2.37 | 2022-06-21 | [13955](https://github.com/airbytehq/airbyte/pull/13955) | Fix "secondary rate limit" not retrying |
| 0.2.36 | 2022-06-20 | [13926](https://github.com/airbytehq/airbyte/pull/13926) | Break point added for `workflows_runs` stream |
Expand Down