question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support for export/import to Gitlab snippets

See original GitHub issue

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 \
    content=@nevergreen-config.json

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 \
    content=@nevergreen-config.json

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)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
GentlemanHalcommented, Jan 6, 2019

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

0reactions
joejagcommented, 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Migrating projects using file exports - GitLab Docs
Existing projects on any self-managed GitLab instance or GitLab.com can be exported to a file and then imported into a new GitLab instance....
Read more >
Snippets - GitLab Docs
Add or remove multiple files. Introduced in GitLab 13.5. A single snippet can support up to 10 files, which helps keep related files...
Read more >
Project import/export API - GitLab Docs
It contains all the necessary information to upload the exported project to a web server or to any S3-compatible platform. For exports, GitLab:...
Read more >
gitlab import/export: add support for system note metadata
This MR adds support for exporting and importing system note metadata, which improves the quality of export/import functionality.
Read more >
Add Project Import/Export Functionality (#3050) · Issues - GitLab
Add the ability to export/import single projects. ... In any case, the more stuff we will support to be migrated, the more export/import...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found