How can I delete binaries attached to a tag/release in GitLab? - gitlab

While adding files to a tag in order to create a release I incorrectly attached the wrong file. I modified the tag again to remove the bad file link, and uploaded a new one. However, where does the wrong file go? I can't see anywhere in Gitlab's administration interface a way to delete the previously uploaded file.
For clarification, the files I refer to are those I drag in the web UI to attach to a release tag and appear in a path like https://gitlab.com/user/repo/uploads/hash/filename.

Related

Delete Repository and history

I had to upload my php code to my GitLab project for my university class. Unfortunately I uploaded the wrong data and now I just want to delete all of the data again und upload my new correct data. When I deleted the data manually I still be able to see them in the history. So is there a way to just delete everything I just uploaded? And I am not allowed to delete the whole project because other members have some subprojects.
I am using Windows 10 by the way.
Thanks a lot!

What is the best way to extract .zip file/folder structure then commit to Github using Github API?

I'm trying to place some config files under version control using Github. The ONLY way to get these particular config files is via a GET request to the hosting server. Server responds with a .zip file.
.zip file structure looks similar to:
|-Folder1
--|-File1.json
--|-File2.json
--|-Pic1.jpg
|-Folder2
--|-File3.json
--|Folder3
----|Pic2.jpg
|-File4.json
|-File5.json
As you can see, its a mix of text and binary files. Also has a nested folder structure.
I need to:
Commit this .zip file to Github using the Github REST API (no problem there)
But BEFORE committing, how can I programmatically extract the folders and files (LEAVING THE FOLDER STRUCTURE IN PLACE)
Commit the results to Github
I've checked the question/solutions mentioned here, but they don't quite match/are a few years old.
Anyone have a workflow for doing this? I have to imagine SOMEONE has come across similar requirements.
I ended up using Power Automate to handle this.
Basically,
GET .zip file
Add it to OneDrive for Business
Extract it there (folder structure is "flattened", but luckily OneDrive "keeps" it by renaming each file)
Example: Folder1/File1.json in the .zip becomes Folder1_File1.json once extracted
When committing to Github via api, I just did a replace for the filename; INCLUDING the / as part of the path.
Example URL: https://api.github.com/repos/SeaDude/replace(items('FOR_EACH_app')?['properties']?['DisplayName'], ' ', '-')/contents/replace(items('FOR_EACH_source_file_2')?['Name'],'_','/')
Apparently, you can specify an empty (or non-empty) path as part of an API commit. If the directory is empty, Github will create it!

Error when attempting to Publish Customizations (Cannot access the uploaded file)

We've recently created a second Company (id=3) based on a snapshot of our original company (id=2). I am attempting to publish a change to one of the Customization Projects in the new company. The file upload/save worked fine, but publishing leads to this error:
Publish Customization
Compiled projects: AA, BB, CC, DD
Validation has been started.
PX.Data.PXException: Cannot access the uploaded file. Failed to get the
latest revision of the file 9a65331c-ad34-477c-9759-2c414dead49f
at Customization.CstBinFile.GetFileFromDb()
at Customization.CstBinFile.SaveFiles(FilesCollection context)
at Customization.CstDocument.GetFiles(FilesCollection context)
at Customization.CstManager.ValidateDocument(CstDocument doc, Action`1
logMessageDelegate, Boolean patchLibInDB)
at PX.Customization.CstValidationProcess.ValidateCurrentDocument(Action`1
logMessage)
at PX.Customization.CstValidationProcess.CompileInternal()
at PX.Customization.CstValidationProcess.<>c__DisplayClass6_0.
<ProcessRequest>b__0()
This attempt represents the first publish within this Company.
I retried the upload/save, but still no luck.
Our version is: 6.10.0010.
How do I overcome this error?
Any help would be great. Thanks.
This can happen when the customization projects reference a file that has been removed from the database. Customization project still has the file reference ID but the database doesn't contain a file associated with that ID anymore.
If this is the cause of your error, you can correct it by removing and adding back missing files. To do this, go to the Files section of your customization project. Click on each file link.
If the file is missing in database, an error message popup will appear. For these, remove the file link reference and add it back again. When files are not missing, they will appear like in the screenshots below.

How to tell Gitbook where to store files locally?

I just want to create a simple gitbook on my local drive, not attached to any remote repository. I went to File->Change Library Path... and pointed to the place where I want my files to go. When I create a new book, Gitbook puts some stuff in that library path that looks right: README.md, etc. But when I change README.md in Gitbook and save the file, it doesn't save to the README.md it created when I created the book. In fact I can't even figure out where it saved my changes, even after doing a find/grep on my entire hard drive.
Edit: I need to know where it saves, so I can run the command-line gitbook to create a pdf.
Which OS are you using?
On Windows, the default directory is C:\Users\username\GitBook
I had troubles with this when I first started too.
Here is some background that may help you
There are three flavors of gitbook: The online editor (storage is on Gitbook.com or Github), the offline editor (same storage + local at C:\Users\Documents\Gitbook), and the CLI toolchain (any storage you desire).
If you talking about issuing commands, you want to install the toolchain
If you are running Windows, I can't help, but when you switch to Ubuntu :) go to toolchain.gitbook.com to see the the instructions.
Hope this helps
Yes, its weird that the changes are not immediately reflected in the physical file. I changed something and saved again, that actually made the first save visible. :D Try it once, this may work for you too.
Gitbook Editor works with git history only. So externally edited and not committed files in that folder will not be identified in the editor. However, when you save the files in gitbook editor, it creates a commit and then only it will be reflected in the physical drive location.
You can find more about the issue here: https://github.com/GitbookIO/feedback/issues/101
Currently there's no way to explicitly tell GitBook where to store files, however we use a simple workaround which allows us to use the GitBook Editor to edit a book in our own git repository but keep control of how and when we commit changes.
We have a docs directory in our project which contains the gitbook which is symlinked to the folder GitBook uses to store its own books. This directory has its own .git folder ignored from a parent directory as we don't need GitBooks commits.

Is there a module or simple way to allow the cc.net.config file to be seen from the webdashboard?

I'd like to be able to have either web dashboard logged in administrators or general users depending on which the team prefers be able to see the contents of this file without remoting into the box, is this possible using the webdashboard?
This is not an answer to how it can be seen from the web dashboard...
... but it is possible to store the ccnet.config file in source control and set up a special build on the build server that automatically retrieves the newest config file.
This way you do not even have to remote into the box in order to edit the contents of the file.
See more details in the documentation:
http://confluence.public.thoughtworks.org/display/CCNET/Configure+CruiseControl.Net+to+Automatically+Update+its+Config+File

Resources