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: add workflow_jobs stream #16534

Merged
merged 19 commits into from
Sep 21, 2022
Merged

Source Github: add workflow_jobs stream #16534

merged 19 commits into from
Sep 21, 2022

Conversation

Mainara
Copy link
Contributor

@Mainara Mainara commented Sep 9, 2022

What

This PR adds a new stream for github source: workflow_jobs

How

Used the endpoint: https://docs.github.com/pt/rest/actions/workflow-jobs#list-jobs-for-a-workflow-run to lists jobs for a workflow run and create a stream.

Recommended reading order

  1. x.java
  2. y.python

User Impact

There is no breakchanges, just a new stream was added.

Pre-merge Checklist

Updating a connector

Community member or Airbyter

  • Grant edit access to maintainers (instructions)
  • Secrets in the connector's spec are annotated with airbyte_secret
  • Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • Code reviews completed
  • Documentation updated
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • Changelog updated in docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
  • PR name follows PR naming conventions

Tests

Unit

airbyte-integrations/connectors/source-github/unit_tests/test_stream.py::test_stream_workflow_jobs_read_incremental ✓
airbyte-integrations/connectors/source-github/unit_tests/test_stream.py::test_stream_workflow_jobs_full_refresh ✓

@CLAassistant
Copy link

CLAassistant commented Sep 9, 2022

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added area/connectors Connector related issues area/documentation Improvements or additions to documentation labels Sep 9, 2022
@sajarin sajarin changed the title Github source: add workflow_jobs stream Source Github: add workflow_jobs stream Sep 9, 2022
@sajarin sajarin added the bounty-L Maintainer program: claimable large bounty PR label Sep 9, 2022
@sajarin
Copy link
Contributor

sajarin commented Sep 9, 2022

Hi, thanks for the PR. This PR will be reviewed by one of our community maintainers as part our of Community Maintainer Program. Someone will be assigned shortly, thanks for being patient!

@Mainara
Copy link
Contributor Author

Mainara commented Sep 9, 2022

This PR is related to this issue: #16360

@sajarin sajarin mentioned this pull request Sep 13, 2022
37 tasks
@YiyangLi
Copy link
Contributor

/test connector=connectors/github

@sajarin
Copy link
Contributor

sajarin commented Sep 14, 2022

/test connector=connectors/source-github

🕑 connectors/source-github https://github.com/airbytehq/airbyte/actions/runs/3054767833
❌ connectors/source-github https://github.com/airbytehq/airbyte/actions/runs/3054767833
🐛 https://gradle.com/s/ypjdx2era5q4s

Build Failed

Test summary info:

=========================== short test summary info ============================
FAILED test_incremental.py::TestIncremental::test_state_with_abnormally_large_values[inputs0]
=================== 1 failed, 38 passed in 292.94s (0:04:52) ===================

@YiyangLi
Copy link
Contributor

@Mainara Thanks for your contribution. It looks like the Workflow_jobs stream supports incremental sync, which will run the test called TestStateWithAbnormallyLargeValues, here is the documentation.

Basically, it will read the file abnormal state from the json file, and it expects to return zero results because the state value is abnormally huge. Can you add a state value for workflow_jobs?

@YiyangLi
Copy link
Contributor

/test connector=connectors/source-github

@py-paulo
Copy link
Contributor

@YiyangLi we made the required changes, can you please validate it?

@sajarin
Copy link
Contributor

sajarin commented Sep 19, 2022

/test connector=connectors/source-github

🕑 connectors/source-github https://github.com/airbytehq/airbyte/actions/runs/3083224659
✅ connectors/source-github https://github.com/airbytehq/airbyte/actions/runs/3083224659
Python tests coverage:

Name                             Stmts   Miss  Cover
----------------------------------------------------
source_github/utils.py              14      0   100%
source_github/github_schema.py    8807      0   100%
source_github/__init__.py            2      0   100%
source_github/graphql.py           145      1    99%
source_github/streams.py           779     39    95%
source_github/source.py            104     27    74%
----------------------------------------------------
TOTAL                             9851     67    99%
	 Name                                                 Stmts   Miss  Cover   Missing
	 ----------------------------------------------------------------------------------
	 source_acceptance_test/base.py                          10      4    60%   15-18
	 source_acceptance_test/config.py                        83      6    93%   78-80, 84-86
	 source_acceptance_test/conftest.py                     164    164     0%   6-282
	 source_acceptance_test/plugin.py                        48     48     0%   6-104
	 source_acceptance_test/tests/test_core.py              329    111    66%   39, 50-58, 63-70, 74-75, 79-80, 164, 202-219, 228-236, 240-245, 251, 284-289, 327-334, 374-376, 379, 439-448, 477-478, 484, 487, 520-530, 543-568, 573-577
	 source_acceptance_test/tests/test_full_refresh.py       52      2    96%   34, 65
	 source_acceptance_test/tests/test_incremental.py       121     25    79%   21-23, 29-31, 36-43, 48-61, 208-216
	 source_acceptance_test/utils/asserts.py                 37      2    95%   57-58
	 source_acceptance_test/utils/common.py                  77     17    78%   15-16, 24-30, 47-54, 64, 67
	 source_acceptance_test/utils/compare.py                 62     23    63%   21-51, 68, 97-99
	 source_acceptance_test/utils/connector_runner.py       110     48    56%   23-26, 32, 36, 39-64, 67-69, 72-74, 77-79, 82-84, 87-89, 92-110, 144-146
	 source_acceptance_test/utils/json_schema_helper.py     105     13    88%   30-31, 38, 41, 65-68, 96, 120, 190-192
	 ----------------------------------------------------------------------------------
	 TOTAL                                                 1325    463    65%

Build Passed

Test summary info:

All Passed

@sajarin
Copy link
Contributor

sajarin commented Sep 19, 2022

/publish connector=connectors/source-github

🕑 Publishing the following connectors:
connectors/source-github
https://github.com/airbytehq/airbyte/actions/runs/3084608070


Connector Did it publish? Were definitions generated?
connectors/source-github

if you have connectors that successfully published but failed definition generation, follow step 4 here ▶️

@Mainara
Copy link
Contributor Author

Mainara commented Sep 19, 2022

/publish connector=connectors/source-github auto-bump-version=false

@Mainara
Copy link
Contributor Author

Mainara commented Sep 20, 2022

@sajarin We verify that the image of the new version has already been published: airbyte/source-github:0.3.0, and the error is precisely because he tried to publish again this version. What can we do with this situation?

@davydov-d
Copy link
Collaborator

hey @sajarin can we please merge this PR? looks like it's completed.
it currently blocks from testing new ones(https://github.com/airbytehq/airbyte/actions/runs/3096389815/jobs/5011926155) as the image is published but not merged

@sajarin sajarin merged commit 97b9c74 into airbytehq:master Sep 21, 2022
@sajarin
Copy link
Contributor

sajarin commented Sep 21, 2022

Should be good to go @davydov-d.

Thanks for the PR @Mainara and @py-paulo and thanks for the review @YiyangLi!

robbinhan pushed a commit to robbinhan/airbyte that referenced this pull request Sep 29, 2022
* feat(workflow-jobs)!: new class 'WorkflowJobs' to get job informations from Github;

* feat(workflow-jobs)!: unit test to new class 'WorkflowJobs';

* feat(test_stream/test_stream_workflow_jobs_read_incremental)!: support to method incremetal in unit test to class 'WorkflowJobs';

* feat(test_workflow): unit test incremental and full refresh to class 'WorkflowJobs';

* docs: updated github docs

* docs: updated github docs

* docs: updated github.md

* docs: updated github.md

* fix: add workflow_jobs in abnormal tests, use 'start date' in source and unit test;

* fix: add workflow_jobs in 'abnormal_state.json' and 'sample_state.json' for integration tests;

Co-authored-by: Paulo Roberto <paulo.rb.beserra@gmail.com>
Co-authored-by: Paulo Roberto <71179739+py-paulo@users.noreply.github.com>
jhammarstedt pushed a commit to jhammarstedt/airbyte that referenced this pull request Oct 31, 2022
* feat(workflow-jobs)!: new class 'WorkflowJobs' to get job informations from Github;

* feat(workflow-jobs)!: unit test to new class 'WorkflowJobs';

* feat(test_stream/test_stream_workflow_jobs_read_incremental)!: support to method incremetal in unit test to class 'WorkflowJobs';

* feat(test_workflow): unit test incremental and full refresh to class 'WorkflowJobs';

* docs: updated github docs

* docs: updated github docs

* docs: updated github.md

* docs: updated github.md

* fix: add workflow_jobs in abnormal tests, use 'start date' in source and unit test;

* fix: add workflow_jobs in 'abnormal_state.json' and 'sample_state.json' for integration tests;

Co-authored-by: Paulo Roberto <paulo.rb.beserra@gmail.com>
Co-authored-by: Paulo Roberto <71179739+py-paulo@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/connectors Connector related issues area/documentation Improvements or additions to documentation bounty bounty-L Maintainer program: claimable large bounty PR community connectors/source/github reward-150
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

8 participants