Skip to content

Conversation

@jjmerchante
Copy link
Contributor

This PR adds a new model and two new endpoints to manage repositories in GrimoireLab core:

  • /scheduler/add_repository: This endpoint allows users to add a new repository for analysis. If the repository already exists, it is updated.

  • /scheduler/repositories: This endpoint provides a list of available repositories in GrimoireLab and task information. It includes filtering options for the backend, category, and URI.

@jjmerchante jjmerchante force-pushed the manage-repositories branch 3 times, most recently from ef91004 to de04607 Compare February 4, 2025 11:08
Copy link
Member

@sduenas sduenas left a comment

Choose a reason for hiding this comment

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

I think we should keep this simpler. The API will change a lot and we don't need to include behaviours or operations that we could remove.

uri = CharField(max_length=MAX_SIZE_CHAR_FIELD)
datasource_type = CharField(max_length=MAX_SIZE_CHAR_FIELD)
datasource_category = CharField(max_length=MAX_SIZE_CHAR_FIELD)
task = OneToOneField(EventizerTask, on_delete=CASCADE, related_name="repository", null=True, default=None)
Copy link
Member

Choose a reason for hiding this comment

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

This can be enough for now but in the future we would need a 0:N relationship.

@jjmerchante jjmerchante force-pushed the manage-repositories branch 2 times, most recently from 12801aa to ace68ab Compare February 5, 2025 08:57
@sduenas sduenas force-pushed the manage-repositories branch from ace68ab to 374778a Compare February 5, 2025 14:24
Copy link
Member

@sduenas sduenas left a comment

Choose a reason for hiding this comment

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

The main change I propose is to move datasources as an app at the same level of scheduler.

This commit introduces a new model, `Repository`, which allows
easier management of repositories. With this model, repositories
can be uniquely related to tasks.

Signed-off-by: Jose Javier Merchante <[email protected]>
This commit adds two new API endpoints for managing repositories:

- /scheduler/add_repository: This endpoint allows users to add a new
   repository for analysis.

- /scheduler/repositories: This endpoint provides a list of available
   repositories in GrimoireLab along with task information. It includes
   filtering options for backend, category, and URI.

Signed-off-by: Jose Javier Merchante <[email protected]>
Copy link
Member

@sduenas sduenas left a comment

Choose a reason for hiding this comment

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

LGTM

@sduenas sduenas merged commit 62cd1b9 into chaoss:main Feb 6, 2025
5 checks passed
@jjmerchante jjmerchante deleted the manage-repositories branch August 22, 2025 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants