How to import repo from gitlab into Phabricator via phab api? - api

I want to create a batch of Repository in Phabricator. These repo already created in gitlab, So i want to just export them into Phabricator via APIs. But i didn't find those APIs worked for this. i could do this manually via Phab UI, like this, while it is not efficient for batch of repository.enter image description here

Did you try diffusion.repository.edit? That should be suitable for creating the repositories. Then either use git to push the repository contents, or use diffusion.uri.edit to set all other URLs to read-only temporarily and add an "observe" URI pointing to the gitlab repository, then after everything is all synced, remove the gitlab URL and set the others back to read/write.

Related

Restore amplify backend environment

I've gotten an Amplify project dropped in my lap where the backend environment is deleted (or lost when the project were moved to another account).
I haven't worked with Amplify before, so I'm not sure how "automatic" everything is.
I noticed that the project has a folder called 'amplify-backup' which contain a bunch of json and graphql config files, so I assumed that I could use those somehow to restore the backend environment in AWS, but I can't seem to find any information on how to do so.
There's currently no backend environment in the AWS console and I don't really know which services the backend environment should contain.
Is it possible to restore the backend environment and all the services that the application need or do I need to figure out which services are needed?
If so, any pointers on how to find which services that are used?
If the project files still exist (amplify directory), you may be able to re-create the project with the existing resources.
One idea could be to clone the git repository from when the amplify project files were intact and run amplify init
OR
amplify-backup is generally generated automatically when doing commands with amplify. You could try rename to amplify and run amplify init.
See more here for re-creating an amplify project on another account: https://docs.amplify.aws/cli/migration/cli-migrate-aws-account/

How to push Fossil local repository to remote hosting

It would be great if you could help me with one thing.
I'm using Fossil as my version manager. Using this on my PC is not a problem but when I try to push it to remote repository I can't.
Here's the thing:
When inside folder with my repository I type
fossil push https://chiselapp.com/user/sebatbg/repository/nres
I get info that:
Error: Wrong project
When I type
fossil push https://sebatbg#chiselapp.com/user/sebatbg/repository/nres
It asks for my password but when I enter it fossil says that Login failed
I tried both my pass to chisel app and for specific repository but result is the same.
Could anyone tell me step by step how to do the push?
Thank you
Fossil assigns a unique ID, called the "project ID", to each new repository. The error message "Wrong project" means that you've got different repositories locally and remotely, that their project-IDs don't match.
The only way I know to publish an existing local repository on Chisel is to upload said repository, and then set the remote-url of your local repository to the Chisel URL, either explicitly or by pulling from the URL.
I had a similar problem. I had cloned a remote repository, but could not push to it.
I could solve it by adding the username to the remote url
remote-url https://{username}#chiselapp.com/user/{chiselab-user}/repository/{repository-name}
you are then prompted for the password of the remote repository.
If you have an existing local repository that you would like to upload to the chiselapp hosting service, the process can be a bit awkward. If your repository is smaller than 8M, chiselapp provides a command Upload repository that may suit your purposes. Otherwise, this is what you need to do:
Navigate to a source tree for the local repository.
Issue the fossil info command and copy the project-code of the local
repository. This is a SHA1 hash.
Log in to chiselapp.com website and click on the Create Repository
link in the header of the home page.
Paste the previously copied project-code into the Override Project Code
field of the resulting form.
Fill the remaining fields as appropriate and click the Create Repository
button at the bottom of the page.
Record the password that is then assigned to you.
Navigate to the chiselapp dashboard and click on the name of the newly
created repository. This should bring you to the fossil web interface of this repository.
Login to the new repository using your local username and the recorded
password. This should be the only user so far and should have setup user permissions.
Navigate to the Admin/Stats page and check that the Project ID of the new
remote repository matches the project-code of the local repository.
Back in the local repository's source tree issue the command
fossil push https://<username>:<recorded-password>#chiselapp.com/user/<username>/repository/<repository-name> -R <local-repository-file>

How to switch Intellij Idea project vcs between Gitlab and Amazon CodeCommit?

I am new with Amazon codecommit.
Following their instruction, I did some works like below
make a new IAM user with AdministratorAccess
make a new codecommit repository
install awscli and did aws configure
When I right finished those things, I could pull/push from codecommit.
However it became disabled with intellij Idea.
I did something like...
I pull a project from gitlab
git remote rm origin
git remote add origin [code commit url]
git branch --set-upstream-to origin/master
Now I type git [pull / push] origin master, I got this error message.
unable to access 'https://git-codecommit.ap-northeast-1.amazonaws.com/v1/repos/test17/': The requested URL returned error: 403
When I access this url via browser, it requires id/pw. But my IAM user account information is not working.
What should I do? Is there any way to switch gitlab and codecommit in intellij?
Thanks.
IntelliJ does not use awscli. It uses the default system shell.
From the description, it looks like push/pull does not work for the command-line git in the native shell, so the issue is not IntelliJ-related.
Probably git tries to use wrong credentials save in its credential.helper, that is why it fails.
Check git config credential.helper to see if any is configured. If there is one, try disabling it or clear the saved credentials.
From the description it looks like you are trying to connect to a CodeCommit repository in Intellij using https. To do this you need to generate GitCredentials(username/password) for your iam user in the IAM console.
Detailed steps are documented in the aws documentation: http://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-gc.html
Once you have the username/password you can use those credentials to connect to your CodeCommit repository in Intellij.
Tested on a Mac. Your milage may vary!
I just ran into the same issue. MacOS stores the GIT UID and PW in the Keychain (in your Applications > Utilities Folder). I deleted all references to AWS Code Commit from the keychain, which forced me to reenter the UID & PW. This seems to have solve the problem.
As a side note: I think this happened because I revoked a prior GIT credential on AWS and created a new one. I think that the keychain was entering the old UID/PW which then failed during authentication.
First, you are going to want to create an IAM user with appropriate permissions and then create Git credentials. Then go to IntelliJ IDEA and say you are opening project from VCS with Git credentials, use the AWS git credentials you created and log in. Once you have logged in, you should be able to pull/push to the repo. If you are still having issues and have checked the credentials you are using are active, along with the IAM user those credentials are attached to have the right permissions, I would recommend creating a ticket on AWS support as there may be something wrong with your account that AWS staff will need to fix.

Where to put S3 secret when deploying using Appveyor?

I've got an Appveyor project setup and working awesomely. Now, I want to upload artifacts S3 for easy hosting. This seems fairly easy as outlined in the documentation. My question is, where do I put the secret with write permission? I don't want to push it to my public repo for obvious reasons. On travis I could put it in an environment variable that was never logged. How would I go about this in Appveyor?
I assume you need to store this in YAML. You can use secure variables. Or you can simple put your secrets in clear text to S3 deployment configuration in UI, then save and press Export YAML and you will have YAML section with secrets encrypted.

mounting a git http repository using davfs

I'm trying to convert some projects at work from subversion to git. The projects are websites and our current subversion setup uses davfs to mount the repository and point apache's document root there. This way apache in dev runs the code currently checked-into the svn repository.
mount:
mount.davfs http://code.repository/svn/site.com /mnt/davfs/site.com
httpd.conf:
ServerName site.com
DocumentRoot /mnt/davfs/site.com
I'm looking for a way to mimic this setup with git. But, from what I understand, mounting a git repository (yes, our git repo is accessed over http) this way will result in the git repository internals showing up as the docroot and not the code itself.
example:
ls /mnt/davfs/gitrepository
Parent Directory
HEAD
branches/
config
description
hooks/
info/
objects/
refs/
Does anyone know if there is a way to achieve the desired effect?
Thanks!
If you want to be able to browse the code, you should be using something like gitweb. If you want to push/pull from the repo, then the internals should be showing up as the docroot.
In a bare repository (the kind that you would use for such a central repo, since you generally don't want to push to non-bare repos), there is no actual checkout of the code files on disk, the only things in that bare repo are the "git internals".
If you want to get a copy of the code on the server out of the repository, you probably want to use git archive - possibly in a post-receive hook if you want it to run every time new code is pushed to the repository. See the following man pages for details:
http://www.kernel.org/pub/software/scm/git/docs/git-archive.html
http://git-scm.com/docs/githooks
Well the git repo is another beast. If you want to browse source code, you need something like gitweb. Mind you, if you just pointed to a svn repo, you'd be looking at internals too; The /mnt/davfs/site.com is probably hosted with apache mod-dav-svn which does something similar as gitweb would do.
You'll want to look at gitweb or competition. Gitweb is IMHO the simplest to setup
https://git.wiki.kernel.org/index.php/Gitweb
For sharing your repository (to make it clonable, e.g.) just serve the tree as static HTTP pages (as docroot directly) because davfs will not (reliably) make it possible for others to push to your repo anyway.
Pushing would be done using the Smart HTTP server, git-daemon or over ssh