-
Notifications
You must be signed in to change notification settings - Fork 193
Gitlab data source connector #3770
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
base: main
Are you sure you want to change the base?
Conversation
test_gitlab_connector.py
Outdated
| @@ -0,0 +1,193 @@ | |||
| #!/usr/bin/env python3 | |||
| """Quick test script for GitLab connector with real credentials.""" | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is to be deleted, just providing it for anyone doing an early review if they want to test how output looks, if pagination works etc.
f71c74a to
62b5f30
Compare
requirements/framework.txt
Outdated
| aiogoogle==5.3.0 | ||
| uvloop==0.20.0; sys_platform != 'win32' | ||
| fastjsonschema==2.16.2 | ||
| pydantic==2.10.6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using pydantic to parse responses from APIs - I think this dependency is worth picking up. Makes the code much more readable and we will get descriptive errors when things fail if the API changes, and the failure will be when we parse the response, not down the line in the code when we try to access an unstructured dictionary.
de63dbd to
0805ea2
Compare
- Implements GitLab connector using GraphQL API and Work Items API - Fetches projects, issues, merge requests, epics, and releases - Includes pagination support and remote validation - Adds functional tests and unit tests with >92% coverage
4112983 to
5962dd0
Compare
76152f5 to
322b99e
Compare
263b24a to
724f8b8
Compare
@artem-shelkovnikov you're right, this got huge because of the queries and the tests and also me opting to add what's effectively structured containers for data coming in from the graphQL and going out of the data source/connector module - the core logic isn't too big I think, but the problem is that reviewing that logic requires you to understand as a reviewer the Gitlab data model. I tested this by creating a large project (Gitlab conveniently provides templates that you can use to build test projects). I think what you're suggesting makes the most sense - we can do a review session synchronously. I'll finish up with the last changes post review and some cleanup and follow up with you. |
cb53716 to
cdedb5a
Compare
c2a703f to
361dfdd
Compare
|
Also to just verify - in the description of the PR the file object doesn't have content, is the content of README extracted somewhere? |
c24c401 to
80b00fd
Compare
@artem-shelkovnikov yeah that's on me. I posted what I got by printing out docs as I'm running get_docs. In our connectors framework, file contents like this readme are structured to be fetched and extracted as a separate lazy download operation. The get_docs method yields tuples of (document, download_func) where the download function is called later by the framework to fetch the actual content. |
daaf344 to
1cfe01d
Compare
f4bed7a to
93ba23d
Compare
2ec1ef2 to
3a066de
Compare
- Change connectors.source to connectors_sdk.source in client, datasource, and tests - Simplify validation_utils.py module docstring to 3 concise lines
cd6deb5 to
06c9888
Compare
09629df to
6c65e09
Compare
Closes https://github.com/elastic/search-team/issues/11093
This PR includes a new data source / connector for Gitlab - mainly fetching project management related entities.
We fetch and generate docs for:
Projects - Repository metadata (name, description, visibility, stars, forks, etc.)
Issues - Project issues with full metadata (assignees, labels, comments, status)
Epics - Group-level epics for tracking larger initiatives (Premium/Ultimate tier)
Merge Requests - Code review requests with discussions, approvals, and reviewers
Releases - Version releases with changelogs, milestones, and asset links
Files - README files (.md, .rst, .txt) from project repositories
Currently this is yielding docs like this:
Still remaining
Checklists
Pre-Review Checklist
config.yml.example)v7.13.2,v7.14.0,v8.0.0)Changes Requiring Extra Attention
Related Pull Requests
Release Note