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

Improve file identification for mypy #28780

Merged
merged 3 commits into from
Aug 1, 2023

Conversation

maxi297
Copy link
Contributor

@maxi297 maxi297 commented Jul 27, 2023

What

The current mypy script flags any file that is different from master. When there is a change to a file on master and you haven't merge master into your branch, it'll prevent you from merging even though there are no conflicts.

Here is an example where I was doing changes to the CATs but got a CI failure:

(.venv) python% git diff --name-only --relative --diff-filter=d remotes/origin/master -- . ':(exclude)unit_tests' | grep -E '\.py$'
airbyte_cdk/connector_builder/message_grouper.py
airbyte_cdk/sources/declarative/models/declarative_component_schema.py
airbyte_cdk/sources/declarative/requesters/http_requester.py
airbyte_cdk/sources/declarative/retrievers/simple_retriever.py
airbyte_cdk/sources/file_based/config/file_based_stream_config.py
airbyte_cdk/sources/file_based/file_types/avro_parser.py
airbyte_cdk/sources/message/repository.py
airbyte_cdk/sources/streams/core.py
airbyte_cdk/sources/streams/http/http.py
airbyte_cdk/sources/streams/http/rate_limiting.py
setup.py

How

Concatenate the following commands:

  • git diff --name-only --relative ':(exclude)unit_tests': unstaged files
  • git diff --name-only --staged --relative ':(exclude)unit_tests';: staged files
  • git diff --name-only master... --relative ':(exclude)unit_tests'; }: commit files

After that, grep and filter out duplicates

@maxi297 maxi297 requested a review from a team as a code owner July 27, 2023 13:38
@octavia-squidington-iii octavia-squidington-iii added the CDK Connector Development Kit label Jul 27, 2023
@maxi297 maxi297 requested review from girarda and removed request for a team July 27, 2023 13:51
Copy link
Contributor

@girarda girarda left a comment

Choose a reason for hiding this comment

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

:shipit:

@maxi297 maxi297 merged commit 48e4517 into master Aug 1, 2023
@maxi297 maxi297 deleted the maxi297/improve-file-diff-identification-for-mypy branch August 1, 2023 22:14
bnchrch pushed a commit that referenced this pull request Aug 3, 2023
* Improve file identification for mypy

* Catch files that are not yet commited as well

* add staged files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CDK Connector Development Kit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants