MeltanoLabs / tap-gitlab

Singer.io Tap for extracting data from Gitlab's API
GNU Affero General Public License v3.0
8 stars 25 forks source link

Fix so this runs in the meltano demo project #77

Closed aaronsteers closed 2 years ago

aaronsteers commented 2 years ago

This addresses the issues causing the demo project to fail.

What I found was that we were using project_path and group_path for the endpoints. The docs (at least for a few of the endpoints) say you can use project_id or an escaped version of the project name/path - with some endpoints seeming to to inconsistently be bothers if / in a project path like meltano/meltano is escaped.

Some endpoints that were failing for me before would succeed if I swapped out the project or group path for the ID.

Related to: https://gitlab.com/meltano/demo-project/-/merge_requests/17 which is being worked on in parallel

aaronsteers commented 2 years ago

Documenting here: The legacy tap was failing silently on project labels:

2m2022-05-09T22:49:20.132511Z [info     ] INFO GET https://gitlab.com/api/v4/projects/7603319/labels cmd_type=extractor job_id=gitlab-to-jsonl name=tap-gitlab run_id=f29951e5-2d1c-4add-a769-ddbde464086e stdio=stderr
2022-05-09T22:49:20.133420Z [info     ] INFO Skipping request to https://gitlab.com/api/v4/projects/7603319/labels cmd_type=extractor job_id=gitlab-to-jsonl name=tap-gitlab run_id=f29951e5-2d1c-4add-a769-ddbde464086e stdio=stderr
2022-05-09T22:49:20.134089Z [info     ] INFO Reason: 401 - b'{"message":"401 Unauthorized"}' cmd_type=extractor job_id=gitlab-to-jsonl name=tap-gitlab run_id=f29951e5-2d1c-4add-a769-ddbde464086e stdio=stderr

I'm going to remove labels from the demo project's selected streams until we have positive confirmation that this endpoint is working with those creds.

UPDATE: This same error appears in legacy logs for these streams:

laurentS commented 2 years ago

Tangentially related, we just updated tap-github to use project IDs instead of paths for stability reasons (we were getting problems with repos being renamed). I think what you're doing in this PR is going in the right direction :)

sonarcloud[bot] commented 2 years ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication