Can a repository at gerrit.wikimedia.org be used in an ADD
command in a Dockerfile?
Alexander Mashin talk 14:48, 15 October 2023 (UTC)
Talk:Gerrit/Tutorial
There are tgz links (e.g. on https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+/refs/heads/master), but honestly I’d just install Git in the container and clone the repo using that. If you want to avoid having Git in the final image, use a different stage (use multiple FROM
instructions in the same Dockerfile).
OK, thank you.
Alexander Mashin talk 14:59, 2 November 2023 (UTC)
@Taavi: Help:Create a Wikimedia developer account doesn’t exist, so your edit didn’t really fix anything. Please create the page or fix the link for real. (And next time use the preview to ensure that the link is blue.)
Fixed, thanks.
@AKlapper (WMF) I've change this page to just describe how to use Git to interact with Gerrit. It doesn't describe anything else about Gerrit. That has been moved to other pages such as Gerrit/Web tutorial.
@Lectrician1 ...which makes it Gerrit specific, due to URLs like "gerrit.wikimedia.org", and due to workflows like "git review".
Okay, but by naming this the main "Gerrit tutorial" it makes it seem as if Git is the only way you use Gerrit. You can also use Gerrit using the web interface. That's why I suggested changing it to "Git tutorial" to differentiate it.
Git is the only way to use Gerrit (on a server) as Gerrit does not work without Git repositories behind it, but I assume you refer to installing a Git client on your machine from a user perspective, indeed. The problem is that there are several meanings here, I'm afraid... :-/ And I do not think that many folks use the (quite non-intuitive) web interface, so using git is the more common way I'd think. See also previous discussion and feedback in Topic:X9mxl87i9na7ppu9.
I think people do use the web interface and it is easy to use. I personally used the web interface to make my first changes because I could get setting up SSH keys to work. It was very challenging. Just recently on the MediaWiki Discord server I saw someone not be able to set up SSH keys and they used the web interface instead. That's why I think it's important to show users that the web interface is an available option for them to use.
The web interface is a nice alternative, indeed.
The Gerrit setup process seems to be the main blocker inhibiting newcomers to help with development (once they managed to actively reach this page).
Are there any ongoing projects or issues or debate about either simplifying the process or replacing it?
For example by just using Visual Studio Code and git without Gerrit and/or a GUI that takes the user through a simple step-by-step process to download, install and configure everything that's needed? Using that GUI would not require technical expertise or much time and it would automatically solve/prevent any problems. It (e.g. a Qt one) could also get developed further to also set up other things needed for various WP development projects like the MediaWiki docker container etc. (note that it needs to internally do things like comparing hashsums which it could display)
I think the Gerrit requirements are the or one of the major technical(!) bottlenecks that cause the lack of developers (even though the technical aspects are not even half of the problem). If this hasn't been discussed so far which would be the best places to propose this?
Gerrit is maybe not the "main blocker" but data shows it is one obstacle. See GitLab consultation for ongoing work to replace it.
Thanks, yes it only seems to be the main blocker to me. Other obstacles once they managed to actively reach this page(!) are probably further down so less inhibitive because by then they already got started developing. GitLab would make things much easier (a GUI could be still be useful for the same reasons once GitLab is being used).
There should also be (shorter?) tutorial for people that don't want to install anything (want to edit by web, if it's possible).
And alternative way to request for smaller changes (why do I need to create an account to propose a change that has only few lines?).
There is Gerrit/Tutorial/tl;dr for "short". There is Gerrit/Tutorial#Editing via the web-interface for "web".
Why to create an account? Because of authorship (accountability) and licenses, basically. Size of a patch is unrelated.
After cloning a repository, I realized that the remote branch changed to main. This however is not reflected in this documentation (Gerrit tutorial). Could this be modified now or should one created a Phabricator ticket for this modification.
Hi, which "a repository" is this about?
See also Inclusive language for a rational for changing the default git branch name
@AKlapper (WMF) I was cloning the commons-recon-service from gerrit. I just noticed that the gerrit tutorial still makes use of the origin master which I was thinking should be origin main(not so sure I had to change to reflect the changes in the origin branch name).
For example in Gerrit/Tutorial#Create a branch changing git checkout -b BRANCHNAME origin/master
to git checkout -b BRANCHNAME origin/main
@BDavis (WMF) Thanks a lot for pointing out the inclusive language page.
Thanks; I've tried to improve in https://www.mediawiki.org/w/index.php?title=Gerrit/Tutorial&type=revision&diff=4807632&oldid=4794289&diffmode=source
@AKlapper (WMF) I think Gerrit/Tutorial#Editing via the web-interface section needs updating.
8. "Under "Files", click the "Edit" button", if i'm not wrong it should be "In the upper right corner, click the "Edit" button".
9. "Under "Files", click "Add", there is no "add" button but ADD/OPEN/UPLOAD button.
@আফতাবুজ্জামান Please feel free to do so - thanks!
git clone ssh://nullpointerexception@gerrit.wikimedia.org:29418/pywikibot/core
Cloning into 'core'...
Connection to gerrit.wikimedia.org closed by remote host.
fatal: the remote end hung up upon initial contact
This happened with all other Gerrit stuff, and cloning from Phabricator and Github is fine.
I absentmindedly forgot to branch master and then committed my change to gerrit. I know it's not the way things are supposed to be done, but do I need to abandon my change on gerrit and redo it?
You could rename the current branch (git branch -m new-name) and then review as normal. Or you could use the -t flag for git-review, and explicitly set the topic (git review -t new-name). I normally do the former in that situation. If later you do want a local master branch, you can just create it then (git checkout -b master gerrit/master).
Or there's probably another more correct way that I'm forgetting. :-) That's usually the case with Git.
Oh, sorry, I just realised: do you mean you've already pushed the change for review? In that case the topic flag is the way to go I think, or you can just change the topic via the web UI.
Yes it's been pushed for review. I've set the topic flag in gerrit. Thanks!
Hello, I have started with the initial set up. I have everything upto adding ssh key to use with git.
I am running the command to make ssh connection to Gerrit: ssh asrajmane193@gerrit.wikimedia.org -p 29418
It gives me the message "ssh: connect to host gerrit.wikimedia.org port 29418: Network is unreachable". I tried changing the port to some random number, 29000. Still no luck.
I am fairly new here. Please help.
Can you try to ping gerrit.wikimedia.org
? What is the result? (i assume you're using a linux distro?)
29418 is the right port. Maybe it is blocked by a local router or firewall?
Is this problem resolved? Because I am still facing this problem, I tried switching the ports but all in vain
I am facing a similar problem. I think it's the proxy. But even after I installed corkscrew, shifted the installed binary to /bin and made appropriate changes to .ssh/config, I get the same error.
The ping to gerrit is fine, btw.
Any leads?
Edit: Resolved.
There was an error in the path to my corkscrew binary in .ssh/config. I corrected it, added my public keys to gerrit, and it worked. :)
I have installed Git from this link and set my username and email.
When I type ls ~/.ssh
in the command line, I get the following message:
'ls' is not recognized as an internal or external command, operable program or batch file.
What have I done wrong?
Use the Git Bash shell, not Windows Command Prompt.
Thank you @KTC, I succeeded, but now I encounter another problem: I can't install git-review. When I run Git Bash as administrator and run the following command: pip install git-review
, I get an error message saying:
bash: pip: command not found
I ran this command after I had installed Python 3.6, but it still doesn't work...
Try "python -m pip ..." or "python3.6 -m pip ...".
@KTC, I still get this error: "bash: python: command not found".
Is it possible to submit Gerrit patches without installing git-review?
If you can't even run python despite having it installed, then something's not set up right in your environment.
My Python is installed in the following directory: C:/Users/Guy/AppData/Local/Programs/Python/Python36-32
Maybe it has something to do with it?