diff --git a/airbyte-config/init/src/main/resources/config/STANDARD_SOURCE_DEFINITION/59f1e50a-331f-4f09-b3e8-2e8d4d355f44.json b/airbyte-config/init/src/main/resources/config/STANDARD_SOURCE_DEFINITION/59f1e50a-331f-4f09-b3e8-2e8d4d355f44.json index d5d140972c959..7999f8cfe9eed 100644 --- a/airbyte-config/init/src/main/resources/config/STANDARD_SOURCE_DEFINITION/59f1e50a-331f-4f09-b3e8-2e8d4d355f44.json +++ b/airbyte-config/init/src/main/resources/config/STANDARD_SOURCE_DEFINITION/59f1e50a-331f-4f09-b3e8-2e8d4d355f44.json @@ -2,7 +2,7 @@ "sourceDefinitionId": "59f1e50a-331f-4f09-b3e8-2e8d4d355f44", "name": "Greenhouse", "dockerRepository": "airbyte/source-greenhouse", - "dockerImageTag": "0.2.5", + "dockerImageTag": "0.2.6", "documentationUrl": "https://docs.airbyte.io/integrations/sources/greenhouse", "icon": "greenhouse.svg" } diff --git a/airbyte-config/init/src/main/resources/seed/source_definitions.yaml b/airbyte-config/init/src/main/resources/seed/source_definitions.yaml index ac93faba15118..a842e98bb00ac 100644 --- a/airbyte-config/init/src/main/resources/seed/source_definitions.yaml +++ b/airbyte-config/init/src/main/resources/seed/source_definitions.yaml @@ -223,7 +223,7 @@ - name: Greenhouse sourceDefinitionId: 59f1e50a-331f-4f09-b3e8-2e8d4d355f44 dockerRepository: airbyte/source-greenhouse - dockerImageTag: 0.2.5 + dockerImageTag: 0.2.6 documentationUrl: https://docs.airbyte.io/integrations/sources/greenhouse icon: greenhouse.svg sourceType: api diff --git a/airbyte-integrations/connectors/source-greenhouse/Dockerfile b/airbyte-integrations/connectors/source-greenhouse/Dockerfile index 7a8111abed8c5..267a7cdc85dc6 100644 --- a/airbyte-integrations/connectors/source-greenhouse/Dockerfile +++ b/airbyte-integrations/connectors/source-greenhouse/Dockerfile @@ -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.5 +LABEL io.airbyte.version=0.2.6 LABEL io.airbyte.name=airbyte/source-greenhouse diff --git a/airbyte-integrations/connectors/source-greenhouse/acceptance-test-config.yml b/airbyte-integrations/connectors/source-greenhouse/acceptance-test-config.yml index e590b104696cf..3c111edb3767e 100644 --- a/airbyte-integrations/connectors/source-greenhouse/acceptance-test-config.yml +++ b/airbyte-integrations/connectors/source-greenhouse/acceptance-test-config.yml @@ -16,8 +16,7 @@ tests: - config_path: "secrets/config_users_only.json" basic_read: - config_path: "secrets/config.json" - # TODO: replace with configured_catalog.json when https://github.com/airbytehq/airbyte/issues/6546 is resolved - configured_catalog_path: "integration_tests/configured_catalog_no_demographics.json" + configured_catalog_path: "integration_tests/configured_catalog.json" - config_path: "secrets/config.json" configured_catalog_path: "integration_tests/configured_catalog_users_only.json" full_refresh: diff --git a/airbyte-integrations/connectors/source-greenhouse/integration_tests/configured_catalog_const_records.json b/airbyte-integrations/connectors/source-greenhouse/integration_tests/configured_catalog_const_records.json index d73400945f18e..ab9dfc20ec80e 100644 --- a/airbyte-integrations/connectors/source-greenhouse/integration_tests/configured_catalog_const_records.json +++ b/airbyte-integrations/connectors/source-greenhouse/integration_tests/configured_catalog_const_records.json @@ -152,6 +152,69 @@ }, "sync_mode": "full_refresh", "destination_sync_mode": "overwrite" + }, + { + "stream": { + "name": "demographics_question_sets", + "json_schema": {}, + "supported_sync_modes": ["full_refresh"] + }, + "sync_mode": "full_refresh", + "destination_sync_mode": "overwrite" + }, + { + "stream": { + "name": "demographics_questions", + "json_schema": {}, + "supported_sync_modes": ["full_refresh"] + }, + "sync_mode": "full_refresh", + "destination_sync_mode": "overwrite" + }, + { + "stream": { + "name": "demographics_answer_options", + "json_schema": {}, + "supported_sync_modes": ["full_refresh"] + }, + "sync_mode": "full_refresh", + "destination_sync_mode": "overwrite" + }, + { + "stream": { + "name": "demographics_answers", + "json_schema": {}, + "supported_sync_modes": ["full_refresh"] + }, + "sync_mode": "full_refresh", + "destination_sync_mode": "overwrite" + }, + { + "stream": { + "name": "applications_demographics_answers", + "json_schema": {}, + "supported_sync_modes": ["full_refresh"] + }, + "sync_mode": "full_refresh", + "destination_sync_mode": "overwrite" + }, + { + "stream": { + "name": "demographics_question_sets_questions", + "json_schema": {}, + "supported_sync_modes": ["full_refresh"] + }, + "sync_mode": "full_refresh", + "destination_sync_mode": "overwrite" + }, + { + "stream": { + "name": "demographics_answers_answer_options", + "json_schema": {}, + "supported_sync_modes": ["full_refresh"] + }, + "sync_mode": "full_refresh", + "destination_sync_mode": "overwrite" } ] } diff --git a/airbyte-integrations/connectors/source-greenhouse/integration_tests/configured_catalog_no_demographics.json b/airbyte-integrations/connectors/source-greenhouse/integration_tests/configured_catalog_no_demographics.json deleted file mode 100644 index ee4f6c3b296ea..0000000000000 --- a/airbyte-integrations/connectors/source-greenhouse/integration_tests/configured_catalog_no_demographics.json +++ /dev/null @@ -1,177 +0,0 @@ -{ - "streams": [ - { - "stream": { - "name": "applications", - "json_schema": {}, - "supported_sync_modes": ["full_refresh"], - "source_defined_cursor": false - }, - "sync_mode": "full_refresh", - "destination_sync_mode": "overwrite" - }, - { - "stream": { - "name": "candidates", - "json_schema": {}, - "supported_sync_modes": ["full_refresh"], - "source_defined_cursor": false - }, - "sync_mode": "full_refresh", - "destination_sync_mode": "overwrite" - }, - { - "stream": { - "name": "close_reasons", - "json_schema": {}, - "supported_sync_modes": ["full_refresh"], - "source_defined_cursor": false - }, - "sync_mode": "full_refresh", - "destination_sync_mode": "overwrite" - }, - { - "stream": { - "name": "degrees", - "json_schema": {}, - "supported_sync_modes": ["full_refresh"], - "source_defined_cursor": false - }, - "sync_mode": "full_refresh", - "destination_sync_mode": "overwrite" - }, - { - "stream": { - "name": "departments", - "json_schema": {}, - "supported_sync_modes": ["full_refresh"], - "source_defined_cursor": false - }, - "sync_mode": "full_refresh", - "destination_sync_mode": "overwrite" - }, - { - "stream": { - "name": "job_posts", - "json_schema": {}, - "supported_sync_modes": ["full_refresh"], - "source_defined_cursor": false - }, - "sync_mode": "full_refresh", - "destination_sync_mode": "overwrite" - }, - { - "stream": { - "name": "jobs", - "json_schema": {}, - "supported_sync_modes": ["full_refresh"], - "source_defined_cursor": false - }, - "sync_mode": "full_refresh", - "destination_sync_mode": "overwrite" - }, - { - "stream": { - "name": "offers", - "json_schema": {}, - "supported_sync_modes": ["full_refresh"], - "source_defined_cursor": false - }, - "sync_mode": "full_refresh", - "destination_sync_mode": "overwrite" - }, - { - "stream": { - "name": "scorecards", - "json_schema": {}, - "supported_sync_modes": ["full_refresh"], - "source_defined_cursor": false - }, - "sync_mode": "full_refresh", - "destination_sync_mode": "overwrite" - }, - { - "stream": { - "name": "users", - "json_schema": {}, - "supported_sync_modes": ["full_refresh"], - "source_defined_cursor": false - }, - "sync_mode": "full_refresh", - "destination_sync_mode": "overwrite" - }, - { - "stream": { - "name": "custom_fields", - "json_schema": {}, - "supported_sync_modes": ["full_refresh"], - "source_defined_cursor": false - }, - "sync_mode": "full_refresh", - "destination_sync_mode": "overwrite" - }, - { - "stream": { - "name": "interviews", - "json_schema": {}, - "supported_sync_modes": ["full_refresh"] - }, - "sync_mode": "full_refresh", - "destination_sync_mode": "overwrite" - }, - { - "stream": { - "name": "applications_interviews", - "json_schema": {}, - "supported_sync_modes": ["full_refresh"] - }, - "sync_mode": "full_refresh", - "destination_sync_mode": "overwrite" - }, - { - "stream": { - "name": "sources", - "json_schema": {}, - "supported_sync_modes": ["full_refresh"] - }, - "sync_mode": "full_refresh", - "destination_sync_mode": "overwrite" - }, - { - "stream": { - "name": "rejection_reasons", - "json_schema": {}, - "supported_sync_modes": ["full_refresh"] - }, - "sync_mode": "full_refresh", - "destination_sync_mode": "overwrite" - }, - { - "stream": { - "name": "jobs_openings", - "json_schema": {}, - "supported_sync_modes": ["full_refresh"] - }, - "sync_mode": "full_refresh", - "destination_sync_mode": "overwrite" - }, - { - "stream": { - "name": "job_stages", - "json_schema": {}, - "supported_sync_modes": ["full_refresh"] - }, - "sync_mode": "full_refresh", - "destination_sync_mode": "overwrite" - }, - { - "stream": { - "name": "jobs_stages", - "json_schema": {}, - "supported_sync_modes": ["full_refresh"] - }, - "sync_mode": "full_refresh", - "destination_sync_mode": "overwrite" - } - ] -} diff --git a/airbyte-integrations/connectors/source-greenhouse/source_greenhouse/source.py b/airbyte-integrations/connectors/source-greenhouse/source_greenhouse/source.py index 7496bc0a5db11..9f54797433930 100644 --- a/airbyte-integrations/connectors/source-greenhouse/source_greenhouse/source.py +++ b/airbyte-integrations/connectors/source-greenhouse/source_greenhouse/source.py @@ -11,11 +11,18 @@ from requests.auth import HTTPBasicAuth from source_greenhouse.streams import ( Applications, + ApplicationsDemographicsAnswers, ApplicationsInterviews, Candidates, CloseReasons, CustomFields, Degrees, + DemographicsAnswerOptions, + DemographicsAnswers, + DemographicsAnswersAnswerOptions, + DemographicsQuestions, + DemographicsQuestionSets, + DemographicsQuestionSetsQuestions, Departments, Interviews, JobPosts, @@ -62,6 +69,13 @@ def streams(self, config: Mapping[str, Any]) -> List[Stream]: Scorecards(authenticator=auth), Sources(authenticator=auth), Users(authenticator=auth), + ApplicationsDemographicsAnswers(authenticator=auth), + DemographicsAnswers(authenticator=auth), + DemographicsAnswerOptions(authenticator=auth), + DemographicsQuestions(authenticator=auth), + DemographicsAnswersAnswerOptions(authenticator=auth), + DemographicsQuestionSets(authenticator=auth), + DemographicsQuestionSetsQuestions(authenticator=auth), ] return streams diff --git a/airbyte-integrations/connectors/source-greenhouse/source_greenhouse/streams.py b/airbyte-integrations/connectors/source-greenhouse/source_greenhouse/streams.py index 49a3a9dff42a9..46f5112eea497 100644 --- a/airbyte-integrations/connectors/source-greenhouse/source_greenhouse/streams.py +++ b/airbyte-integrations/connectors/source-greenhouse/source_greenhouse/streams.py @@ -73,13 +73,13 @@ class Applications(GreenhouseStream): """ -class ApplicationsDemographicsAnswers(GreenhouseStream): +class ApplicationsDemographicsAnswers(GreenhouseSubStream, GreenhouseStream): """ Docs: https://developers.greenhouse.io/harvest.html#get-list-demographic-answers """ - def path(self, **kwargs) -> str: - return "demographics/answers" + parent_stream = Applications + path_template = "applications/{parent_id}/demographics/answers" class ApplicationsInterviews(GreenhouseSubStream, GreenhouseStream): @@ -115,59 +115,58 @@ class Degrees(GreenhouseStream): """ -# TODO: uncomment when https://github.com/airbytehq/airbyte/issues/6546 is resolved -# class DemographicsAnswers(GreenhouseStream): -# """ -# Docs: https://developers.greenhouse.io/harvest.html#get-list-demographic-answers -# """ -# -# def path(self, **kwargs) -> str: -# return "demographics/answers" -# -# -# class DemographicsAnswerOptions(GreenhouseStream): -# """ -# Docs: https://developers.greenhouse.io/harvest.html#get-list-demographic-answer-options -# """ -# -# def path(self, **kwargs) -> str: -# return "demographics/answer_options" -# -# -# class DemographicsQuestions(GreenhouseStream): -# """ -# Docs: https://developers.greenhouse.io/harvest.html#get-list-demographic-questions -# """ -# -# def path(self, **kwargs) -> str: -# return "demographics/questions" -# -# -# class DemographicsAnswersAnswerOptions(GreenhouseSubStream, GreenhouseStream): -# """ -# Docs: https://developers.greenhouse.io/harvest.html#get-list-demographic-answer-options-for-demographic-question -# """ -# -# parent_stream = DemographicsQuestions -# path_template = "demographics/questions/{parent_id}/answer_options" -# -# -# class DemographicsQuestionSets(GreenhouseStream): -# """ -# Docs: https://developers.greenhouse.io/harvest.html#get-list-demographic-question-sets -# """ -# -# def path(self, **kwargs) -> str: -# return "demographics/question_sets" -# -# -# class DemographicsQuestionSetsQuestions(GreenhouseSubStream, GreenhouseStream): -# """ -# Docs: https://developers.greenhouse.io/harvest.html#get-list-demographic-questions-for-demographic-question-set -# """ -# -# parent_stream = DemographicsQuestionSets -# path_template = "demographics/question_sets/{parent_id}/questions" +class DemographicsAnswers(GreenhouseStream): + """ + Docs: https://developers.greenhouse.io/harvest.html#get-list-demographic-answers + """ + + def path(self, **kwargs) -> str: + return "demographics/answers" + + +class DemographicsAnswerOptions(GreenhouseStream): + """ + Docs: https://developers.greenhouse.io/harvest.html#get-list-demographic-answer-options + """ + + def path(self, **kwargs) -> str: + return "demographics/answer_options" + + +class DemographicsQuestions(GreenhouseStream): + """ + Docs: https://developers.greenhouse.io/harvest.html#get-list-demographic-questions + """ + + def path(self, **kwargs) -> str: + return "demographics/questions" + + +class DemographicsAnswersAnswerOptions(GreenhouseSubStream, GreenhouseStream): + """ + Docs: https://developers.greenhouse.io/harvest.html#get-list-demographic-answer-options-for-demographic-question + """ + + parent_stream = DemographicsQuestions + path_template = "demographics/questions/{parent_id}/answer_options" + + +class DemographicsQuestionSets(GreenhouseStream): + """ + Docs: https://developers.greenhouse.io/harvest.html#get-list-demographic-question-sets + """ + + def path(self, **kwargs) -> str: + return "demographics/question_sets" + + +class DemographicsQuestionSetsQuestions(GreenhouseSubStream, GreenhouseStream): + """ + Docs: https://developers.greenhouse.io/harvest.html#get-list-demographic-questions-for-demographic-question-set + """ + + parent_stream = DemographicsQuestionSets + path_template = "demographics/question_sets/{parent_id}/questions" class Departments(GreenhouseStream): diff --git a/docs/integrations/sources/greenhouse.md b/docs/integrations/sources/greenhouse.md index a8b57e1459c70..cdd9dd4e7a826 100644 --- a/docs/integrations/sources/greenhouse.md +++ b/docs/integrations/sources/greenhouse.md @@ -57,5 +57,6 @@ Please follow the [Greenhouse documentation for generating an API key](https://d | Version | Date | Pull Request | Subject | | :--- | :--- | :--- | :--- | +| 0.2.6 | 2021-11-08 | [7607](https://github.com/airbytehq/airbyte/pull/7607) | Implement demographics streams support. Update SAT for demographics streams | | 0.2.5 | 2021-09-22 | [6377](https://github.com/airbytehq/airbyte/pull/6377) | Refactor the connector to use CDK. Implement additional stream support | | 0.2.4 | 2021-09-15 | [6238](https://github.com/airbytehq/airbyte/pull/6238) | added identification of accessible streams for API keys with limited permissions |