Step 4 (BE): Version Control for Snippets: Implement git actions in the view (MVP)
Important: All the new functionality must be implemented behind the feature flag :version_snippets
. Besides, it has to be scoped for projects. Therefore, instead of checking if the feature flag is enabled or not (Feature.enabled?(:version_snippets)
), we will check if the feature flag is enabled for specific users (Feature.enabled?(:version_snippets, user)
).
In this issue we will add the new actions Clone via HTTPS
and Clone via SSH
to the Embed/Share
button. We will also add the Clone
button that, when clicked, will display the snippet repository url with the https
and ssh
protocols.
For the BE perspective, we would need to add to GraphQL and the REST endpoints, the SSH and HTTP addresses to clone the repository. This info can be retrieved from the snippet methods: http_url_to_repo
and ssh_url_to_repo
.
If the snippet doesn't have a repository attached, we can check that by calling snippet.repository_exists?
, those endpoints should be nil
.
If possible, it would be nice to only add those endpoints when the feature flag is enabled, but I don't think is possible. If not, the above params should return nil
if the feature flag is disabled for the user.
This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.