action #174592
Updated by tinita 18 days ago
## Observation
Trying to remove old unused needles from https://openqa.opensuse.org/admin/needles for I encountered the error "Unable to push Git commit (/var/lib/openqa/share/tests/openqa/needles): fatal: could not read Username for 'https://github.com': Permission denied". The needles repository was automatically cloned due to https://github.com/os-autoinst/os-autoinst-distri-openQA/blob/master/scenario-definitions.yaml#L10 . We should ensure that https://openqa.opensuse.org/admin/needles can be used to remove needles for this automatically cloned repo.
## Acceptance criteria
* **AC1:** os-autoinst-needles-openQA needles can be removed using https://openqa.opensuse.org/admin/needles
* **AC2:** os-autoinst-needles-openQA is still automatically checked out if not existent existant on an openQA server and AC1 is still true
* **AC3:** git commands will never attempt to prompt for http or ssh credentials
## Suggestions
* Can we just put an ssh remote into the scenario definitions?
* We should probably document that one has to do this somewhere.
* Simply use the [git config to automatically push via ssh](https://git-scm.com/docs/git-config#Documentation/git-config.txt-urlltbasegtpushInsteadOf): `git config --global url."git@github.com:".pushInsteadOf https://github.com/`
```
[url "git@github.com:"]
pushInsteadOf = https://github.com/
```
* Require an ssh remote for the use case where needles are created or removed later?
* Find out why we used https://github.com/os-autoinst/os-autoinst-needles-openQA and not git@github.com:os-autoinst/os-autoinst-needles-openQA.git e.g. unlike ariel:/var/lib/openqa/share/tests/opensuse/products/opensuse/needles which has git@github.com:os-autoinst/os-autoinst-needles-opensuse.git
* Maybe add a mapping (e.g. https://github.com/… to git@github.com - the user depends on the deployment e.g. with gitlab it is also gitlab@) so we can convert HTTP URLs to SSH on the fly when cloning
Back