I have a problem with my releases in GitLab.
I created them in my project with tags. Now I want to remove them, so I deleted the associated tags but my releases are always displayed. I searched on Google and Stack Overflow but I can't find any solutions.
How can I remove these releases without their tags?
Go to Project Overview -> Releases
Click the release you want to delete
Scroll to the bottom. Find the tag icon. Click on the tag.
There is a trash can button for the tag. Deleting the tag will delete the release as well.
By now you can delete releases properly using the API:
https://docs.gitlab.com/ee/api/releases/#delete-a-release
Currently (GitLab v11.9.8) you can't. It's silly, I know, but you can't.
Ivan came up with a workaround if you have only a few releases to delete. His steps are copied below.
Ivan Kostrubin (#ovitente):
For fixing this issue you have to go through those steps
Create tag with the same name and release message that was in release, you will be able to edit this tag.
Open tag's release message for editing
Remove all text
Save it
And release has gone from the release list.
Then you can freely delete tag.
Source:
https://gitlab.com/gitlab-org/gitlab-ce/issues/58549#note_160000873
Check out these GitLab issues:
[#58549] Deleting releases with removed TAG in Release API
[#56026] Make it possible to add/edit/delete a release using the UI
Maybe I'm late but I've created a chrome extension that allows you to do just that, hope it helps :)
https://github.com/tuanddd/grru
Go to Repository -> Tags on the left side Collapse sidebar. Then click on the delete icon on the right of the tag name.
Example:
GitLab 15.3 (August 2022) should improve release management:
Releases usability improvements
In 15.3, we made several improvements that made GitLab Releases easier to use.
Users can now:
delete a release directly in the UI,
set the release date in the UI,
edit the release_at date in the UI, and
easily identify a historical release.
See Documentation, Issue, Issue, Issue and Issue.
For instance: Delete a release, starting with GitLab 15.2:
When you delete a release, its assets are also deleted. However, the associated Git tag is not deleted.
Prerequisites:
You must have at least the Developer role. Read more about Release permissions.
To delete a release in the UI:
On the top bar, select Menu > Projects and find your project.
On the left sidebar, select Deployments > Releases.
In the top-right corner of the release you want to delete, select Edit this release ().
On the Edit Release page, select Delete.
Select Delete release
gitlab-scripts repo
I created a bash script that will remove all releases given a repo name,
purge/releases.sh
There are similarly named purge/tags.sh and purge/packages.sh in the repo. You can call any of them like this,
GITLAB_TOKEN="mytoken" ./reset-repo.sh <repo>
Use the gitlab gem.
gem install gitlab
gitlab delete_project_release 1234 'v1.2.3'
Related
I am trying to create a branch linked from an issue on GitLab. The option to create a branch from the issue however is missing on this particular project. I have an access level of Maintainer on this project.
The current project I'm working on:
I have checked the other project I made a few months back on which I have exactly the same access level, the option that I'm looking for is there.
My previous project (This is a different project btw, not the source of the fork)
The difference being is that the current project I am working on is a forked version of the old repo so I could keep historical branches from the previous version of the project. I also imported the issues from the previous repo to the new one. I tried to create a new test issue but I still can't see the menu.
It seems like I configured something wrong, could you please help me identify why I cannot access this menu? Any help would be appreciated.
Thanks!
After some digging, I found that this may be a current known issue on GitLab. It only happens on forked projects similar to #VonC's answer. However it doesn't show how to resolve the issue.
To resolve the issue you have to remove the project's fork relationship found on the Settings > General > Advance. If you forked the repo from another project, you should see the Remove fork relationship button there. This essentially removes the fork relationship of the project from the original repository. Once done, the Create merge request should pop-up immediately upon refreshing the page. Do note you need an Owner access to see the Remove fork relationship option.
For more details, please refer to this issue and this solution was from here.
Check first if this is similar to issue 39778 which refers to issue
I disable the button for projects which are forked.
The context in when it references (from a fork) issue from the original project.
No "Create merge request" in that case.
I needed to rename tags in a gitlab repo by
git tag new old
git tag -d old
git push origin new :old
but now I stuck with releases, which are linked to the old tags. Is the only solution to create new Releases and delete the old one like this?
Is the only solution to create new Releases and delete the old one
Possibly, because the idea of a release is to be reproductible from an immutable tag.
If a tag is mutated (here, renamed), a new release should be done (even though the tag references the same code).
GitLab 15.4 (September 2022) illustrates that relation with:
Add associated release link to single tag page
In this update, you can now see the associated release when viewing a specific tag’s information page. This allows you to easily know if a release has been created based on that specific tag and to navigate to the release.
See Documentation and Issue.
Given that action's versions derive from their repo's tags.
Can one change an already published version by moving the tag to another commit?
If so, it's a serious security problem.. but I can't find any source to reassure me.
Anyway, it is always possible to use commit id instead of version:)
Yes, that's possible. When a tag is moved to point to a different commit, the corresponding release becomes a draft and it disappears from the Marketplace, but it can be published again.
Notice that an action doesn't need to be published on the marketplace to be used anyway.
Moving tags is actually the official recommendation for major versions and it has been debated; that discussion mentions that versioning will improve when moving to using the GitHub Package Registry for Actions, but that hasn't happened yet and the GitHub roadmap doesn't mention it, as far as I can tell.
I have accidentally deleted a Wiki-page from our repository in Azure DevOps.
(How) can I recover it?
That is not an option for us, since we will loose many changes that
were made after the last version no. up until the date I accidentally
deleted the wiki page.
You can choose Clone wiki to download the wiki repo to local machine.
Then use git commands(git revert or what) locally to get the deleted page, once you find the deleted page, publish it and add it back to Wiki page as a new commit.
I was just able to do this without too much fanfare. The resource that was helpful was this VS community topic. There is an answer that provides a solution that doesn't require you to clone the repo.
The key insight is that you can navigate to the Azure DevOps repo UI for the Git repo that's backing the wiki. The solution author says that the shape of the URL is something like https://dev.azure.com/<organization-name>/<project-name>/_git/<wiki-name>.wiki. This didn't quite work for me because we have a different URL scheme in our organization, but I was able to figure it out after a little trial and error. I later saw that you can get the URL by using the Clone Repo UI in the wiki - it gives you the URL, so you can just copy it and navigate to it.
Anyway, the steps were:
Figure out the URL of the git repo that backs the wiki
Navigate to the revision history for the entire wiki
the current UI shows you the Contents tab by default - switch to History
Scroll until you find the commits that deleted the pages you want to restore
it's one of those list views that populate themselves as you scroll, so you won't be able to use the browser page search efficiently, unfortunately
Revert the commits
In my case, this required clicking on them and creating pull requests to revert, but I was able to merge them myself without involving code reviewers. YMMV
All in all, not a wholly terrible experience, but completely undiscoverable.
Assuming you're managing a provisioned wiki (vs using published code as a wiki):
Look in the top-right corner for the vertical 3-dot menu, where there's an option to view revisions:
Choose the revision you want to revert to (e.g. the one prior to deleting the needed wiki page), from the list (click on its version hash):
From the revision details, select "Revert":
At this point, your wiki should be at its prior state, and your wiki page should once again be available.
Note: If you're using published code as a wiki, you would recover/revert your changes as you would with any other code commit.
More details may be found here.
I couldn't find a way to do this through the Azure DevOps web interface but you can restore the page by reverting the commit that deleted it if you clone the wiki locally.
Clone the wiki to your computer - find the clone wiki option in the menu at the top of the left bar which shows the wiki contents, copy the URL and use to clone locally using your usual git client.
Find the commit that deleted the page, the commit message will start with "Deleted page" then the name of the page you deleted.
Restore the page and commit the change. There are various ways to do this - I reverted the commit, you could checkout the commit and copy the page out to make a new commit. You may get a merge conflict on '.order', I'm not sure what the best thing to do is but I kept the current version and haven't had any problems.
Push the changes to Azure DevOps, refresh and you'll see the page has been restored.
This works even for Project Wikis. I wonder if Azure DevOps has added the functionality that enabled this since some of the other answers have been written.
I am trying to use gitlab mirror repository functionality of gitlab but under Mirror direction, it only shows push option to me, dropdown menu is greyed out. I can not select pull option.
Gitlab version : Gitlab EE 12.8.5-ee Ultimate.
My user account is maintainer.
Am I missing something?
Thanks in advance.
After searching a bit on this got the answer why the pull option was disabled:
Answer :
It appears that the ability to disable mirrors was introduced in GitLab 10.3
So after upgrading gitlab, Admin has to specifically Enable mirror configuration
Enable single checkbox in Admin -> Application Settings -> Repository:
If this checkbox is unchecked, even project owners can't administer mirrors, though the text only says push mirrors.
Reference : https://gitlab.com/gitlab-org/gitlab/issues/13769
From Repository Mirroring
check if the repo was not already configured for pushing (and can no longer be modified for pulling)
some prerequisite might prevent any pulling option.