Page MenuHomePhabricator

extensions including semantic-forms via composer are broken and breaking extension distributor
Closed, DeclinedPublic

Description

Split from T215713

Page-forms seems to have some issue. When extdist tries to download them, it pauses waiting for private package credentials. this breaks things. It will break the script anytime someone commits to one of these repos.

Repos affected: https://codesearch.wmflabs.org/search/?q=mediawiki%2Fpage-forms&i=nope&files=&repos=

Event Timeline

At least one of the problematic extensions is SemanticPageSeries and SemanticImageInput

Actual output looks like:

HEAD is now at 08605a5... Localisation updates from https://translatewiki.net.
Updating dependencies
Package operations: 27 installs, 0 updates, 0 removals
  - Installing composer/installers (v1.9.0): Loading from cache
  - Installing mediawiki/semantic-forms (3.7): Downloading (failed)    Failed to download mediawiki/semantic-forms from dist: The "https://api.github.com/repos/wikimedia/mediawiki-extensions-SemanticForms/zipball/7e9e627853dea94d6b1344383513927fd037903b" file could not be downloaded (HTTP/1.1 404 Not Found)
    Now trying to download from source
  - Installing mediawiki/semantic-forms (3.7): The authenticity of host 'github.com (140.82.114.4)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? yes
Cloning failed using an ssh key for authentication, enter your GitHub credentials to access private repos
Head to https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+extdist-04+2020-05-25+1834
to retrieve a token. It will be stored in "/home/extdist/.composer/auth.json" for future use by Composer.
Token (hidden): 
Invalid token provided.
You can also add it manually later by using "composer config --global --auth github-oauth.github.com <token>"
Cloning 7e9e627853

                                                                                                                     
  [RuntimeException]                                                                                                 
  Failed to execute git clone --no-checkout 'https://no:***@github.com/wikimedia/mediawiki-extensions-SemanticForms  
  .git.git' 'extensions/SemanticForms/' && cd 'extensions/SemanticForms/' && git remote add composer 'https://no:**  
  *@github.com/wikimedia/mediawiki-extensions-SemanticForms.git.git' && git fetch composer && git remote set-url or  
  igin 'https://github.com/wikimedia/mediawiki-extensions-SemanticForms.git.git' && git remote set-url composer 'ht  
  tps://github.com/wikimedia/mediawiki-extensions-SemanticForms.git.git'                                             
                                                                                                                     
  Cloning into 'extensions/SemanticForms'...                                                                         
  remote: Invalid username or password.                                                                              
  fatal:***@github.com/wikimedia/mediawiki-extensions-SemanticForms.git.git/'

Maybe part of the issue is that old REL1_30, etc branches are still using old dependency name.

This might be less of an issue in practise, because except when force rebuilding like i did just now, this code path will only be execute if someone commits to the branch in question.

Maybe part of the issue is that old REL1_30, etc branches are still using old dependency name.

extdist should only be building for REL1_31 and above...

@Bawolff - sorry for the very long delay in responding! Do you know if this is still an issue? If so, how can it be fixed?

Seb35 subscribed.

I remove the tag MediaWikiFarm since page-forms only appears in test/phpunit/, not the root composer.json.

There are no more issue with the mentionned repo SemanticPageSeries (the renaming from semantic-forms to page-forms is finished), but if we want to fix it for an hypothetical other case, including when a repo will be deleted (it will probably happen one day), I have the following proposition:

Add to /etc/gitconfig (or /home/user/.config/git/config) in the extdist VM:

[core]
	sshCommand='ssh -o StrictHostKeyChecking=yes'
[credential]
	helper='!/bin/echo quit=true && /bin/true'

And add a warning in extdist.log if git clone or git fetch returns an error.


This will fix the two following behaviours:

  1. When Github requests a username on https:
$ git -c credential.helper='!/bin/echo quit=true && /bin/true' clone https://github.com/oijwifjojfioe/ojgfirgoiwajgo
Cloning into 'ojgfirgoiwajgo'...
fatal: credential helper '!/bin/echo quit=true && /bin/true' told us to quit
Return code = 128

instead of

$ git clone https://github.com/oijwifjojfioe/ojgfirgoiwajgo
Cloning into 'ojgfirgoiwajgo'...
Username for 'https://github.com': […HANGING]

(See gitcredentials(7) – search "quit attribute" and/or add the environment variable GIT_TRACE=1 to see more details inside Git)

  1. When SSH requests a confirmation of server fingerprint:
$ git -c core.sshCommand='ssh -o StrictHostKeyChecking=yes' clone github.com:oijwifjojfioe/ojgfirgoiwajgo
Cloning into 'ojgfirgoiwajgo'...
No ECDSA host key is known for github.com and you have requested strict checking.
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Return code = 128

instead of

$ git clone github.com:oijwifjojfioe/ojgfirgoiwajgo
Cloning into 'ojgfirgoiwajgo'...
The authenticity of host 'github.com (140.82.121.3)' can't be established.
ECDSA key fingerprint is SHA256:p2QAMXNIC1TJYWeIOttrVc98/R1BUFWu3/LiyKgUfQM.
Are you sure you want to continue connecting (yes/no)? […HANGING]

(See git-config(1) and ssh_config(5))

Closing, because this seems to no longer be relevant, if I understand it correctly - anything requiring "Semantic Forms" should be updated to require "Page Forms" instead.