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

Add support for export/import to Gitlab snippets #264

Closed
5 tasks done
joejag opened this issue Jan 4, 2019 · 6 comments
Closed
5 tasks done

Add support for export/import to Gitlab snippets #264

joejag opened this issue Jan 4, 2019 · 6 comments
Assignees
Labels
new feature A new feature
Milestone

Comments

@joejag
Copy link
Contributor

joejag commented Jan 4, 2019

Feature Request

What would you like to be able to do?

Export and import config to Gitlab in the same manner as Github.

Support both gitlab.com and internal gitlab instances.

Snippets API: https://docs.gitlab.com/ee/api/project_snippets.html

API Examples:

http POST https://gitlab.com/api/v4/snippets?private_token=$PRIVATE_TOKEN \
    title="Nevegreen Config Backup" \
    file_name=nevergreen.json \
    visibility=public \
    [email protected]

http GET https://gitlab.com/api/v4/snippets/$SNIPPET_ID/raw?private_token=$PRIVATE_TOKEN 

http PUT https://gitlab.com/api/v4/snippets/$SNIPPET_ID?private_token=$PRIVATE_TOKEN \
    title="Nevegreen Config Backup" \
    file_name=nevergreen.json \
    [email protected]

Remaining Tasks

Prod code:

  • Handle error messages from GitLab
  • Update schema to add new GitLab config
  • Allow custom hosts to be added to the CSP (similar to iframe)
  • Help text
  • Mobile styling (issue with tabs overflowing)
@joejag joejag added the new feature A new feature label Jan 4, 2019
@GentlemanHal
Copy link
Member

Just wondering out loud, is it worth moving the complexity to the server?

As in we provide a /backup (or whatever) endpoint that just takes the json and a where (or whatever) parameter.

POST /backup
{
    "where": "gitlab",
    "description": "Nevergreen backup",
    "content": {
        ...the json to backup...
    }
}

@GentlemanHal
Copy link
Member

FYI, if we do it from the UI we'll need to update the content security policy connect-src to include gitlab.

@joejag
Copy link
Contributor Author

joejag commented Jan 9, 2019

It's also a bit worse than that @GentlemanHal as if we support internal GitLab servers we will need them to update the server to change the CSP

@GentlemanHal
Copy link
Member

It's also a bit worse than that @GentlemanHal as if we support internal GitLab servers we will need them to update the server to change the CSP

Oh, good point! This would be another advantage of having our own API.

joejag added a commit that referenced this issue Jan 9, 2019
@GentlemanHal GentlemanHal added this to the v4.0.0 milestone Jan 10, 2019
joejag added a commit that referenced this issue Jan 19, 2019
joejag added a commit that referenced this issue Feb 8, 2019
joejag added a commit that referenced this issue Feb 8, 2019
GentlemanHal added a commit that referenced this issue Feb 20, 2019
@joejag
Copy link
Contributor Author

joejag commented Feb 20, 2019

Tested with GitLab official.
Going to test with a hosted GitLab.

@joejag
Copy link
Contributor Author

joejag commented Feb 22, 2019

Tested with a hosted GitLab. All working.

We could improve things by pre-populating the available URLs given the environment variable provided by the user, but given [#271] will make the environment variable redudant I'd suggest we don't do this just now.

@joejag joejag closed this as completed Feb 22, 2019
joejag added a commit that referenced this issue Feb 23, 2019
@GentlemanHal GentlemanHal modified the milestones: v4.0.0, v3.2.0 Mar 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature A new feature
Projects
None yet
Development

No branches or pull requests

2 participants