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

Proposal to add Gitlab functionalities #1094

Closed
wants to merge 2 commits into from

Conversation

fabianospinelli
Copy link

Here the list of file changed or added in order to add the ability to use GitLab instead of GitHub as store repo. For each file, a simple description is given to describe its purpose within the application and the changes made for GitLab:

env.example
It's the file that contains the tokens for the repositories.
In addition to the original GITHUB_TOKEN variable, 2 new variables were added, GITLAB_TOKEN (used for the declarations-related repository) and GITLAB_RELEASES_TOKEN (used for the versions-related repository on which to save datasets in ZIP file format).
config/default.json
The file was modified by adding some new elements within the JSON structure of the file. In the "reminder" element, the same structure as "githubIssues" was added but named "gitlabIssues". In the "declaration" field the name of the repository should be given in the form "<owner_name>/<project_name>"
engine/src/index.js
The file is the module related to the declarations tracking procedure (performed with the "npx ota track" command).
It has been modified by adding checks for the presence of GitHub and GitLab tokens. In either case, the relevant Reporter (for GitHub) or ReporterGitLab (for GitLab) classes are instantiated.
engine/src/reporterGitlab/gitlab.js
This file contains the definition of the Gitlab class and all its related methods for operating on a repository: getRepositoryLabels, createLabel, createIssues, setIssueLabels, openIssue, closeIssue, getIssue, addCommentToIssue, closeIssueWithCommentIfExists, and createOrUpdateIssue. It contains some settings such as the url where to reach the API of the GitLab respo you want to use (for example: https://gitlab.com/api/v4 )
engine/src/reporterGitlab/index.js
This file contains the definition of the Reporter class related to the use of GitLab. Within it, the related methods of the GitLab class described above are invoked.
engine/src/reporterGitlab/labels.json
This file contains, via a JSON structure, the list of labels that must be present on the repository in order to properly create issues. In case no labels are present in the repository thanks to this file they are automatically created during the first run.
engine/src/reporterGitlab/labels.test.js
It's a Javascript file used to test the file "labels.json" to verify that all the info inserted complains with the GitLab constraints.
engine/scripts/dataset/index.js
The file is the module related to the creation of releases and datasets (performed with the "npx ota dataset" command). It has been modified by adding checks for the presence of GitHub and GitLab tokens.
In either case, the relevant publishRelease (for GitHub) or publishReleaseGitLab (for GitLab) classes are instantiated.
engine/scripts/dataset/assets/README.templateGitLab.js
This file contains the template with all the texts and links that are used into every releases created during the "dataset" process.
engine/scripts/dataset/publishGitLab/index.js
The file contains the function to publish a release on a GitLab repository. This function creates a release and the zip file that is attached as asset link to the release.

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.

None yet

1 participant