-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow multiple URLs for a project #28
Comments
As update on the IRC discussion Sep 12 it is important to consider that ssh could have different styles on different remotes, as example: Consider a company who pulls code from both the internal git servers, as well as different remote sources, could have an internal manifest similar to:
As there can be multiple remotes in the same company, and those can use different user@server syntax, e.g. git and bitbucket seems to use git@server, whereas if I remember correctly from when I worked with gerrit, I think the default syntax there is ssh@server. All of this this may make it trickier to make the solution with just an overlay on command line. So splitting to allow to specify bort a url and a ssh on remotes that supports both could be a clear way/ |
As discussed on IRC, I think the URL specifying the transport is a feature, not a bug, and that a potentially better way to handle this would be through adding support for "manifest overlays" similar to device tree overlays; these would be files in With that feature, you could write a file
The main manifest entry fragment from
Would then have its URL overridden from the https:// to the git+ssh version. To ensure determinism, overlays would be applied in sorted order, allowing users to name them 00-first.yml, 01-second.yml, etc. as desired. Seem reasonable? |
sounds reasonable so far, although I need to see the full picture.
and an overlay: 00-ssh-remote.yml:
then how does the user of |
If you're creating your own repo, why not just update the remote URLs in the main manifest? You are already committing to maintaining a copy at that point. |
The point that I'm trying to make, is that Github itself provides to possibility to choose between:
Therefore there is a possibility for any github developer to use any of the two (and they might have a personal preference for one of the methods). As seen in just our little reference group, there is already two who default seems to be using SSH. Therefore, I believe it would make sense that both the As well as other companies forking Zephyr has the ability to described both a |
CC @nashif |
@mbolivar did some thinking on this.
as example:
then default url and transport will be first in list, but user can request other preference, e.g. |
Hm, I see what you mean. I think it would be better to use a real YAML list for this, though. Semicolons are reserved sub-delimiters in URLs. Using the native list type also lets us keep pykwalify schema checking, and add more metadata. Something like:
Commentary:
To clarify, the following
We would need to come up with some default assumptions about the
Perhaps this could be a configuration option in addition to a manifest In
In
|
Correct, but that could be handled by requiring such characters to be escaped. Just as you would need to do if trying to use a url containing
Now, that is an argument I accept ;) Been reading up on yaml, and seems this is an allowed sequence, close to your example:
and we don't need to specify transport, as it is given by the URL:
it could be provided If no setting is given or the transport is not in |
Sorry again for choosing such a poor name as "transport". I'm trying with this field to specify both the VCS (git, for now) and the actual network transport. So I'm mixing application layer and L4 in the OSI sense in my above proposal, which is why I think it's not quite right. My point is that if we are going to make this change, we should do so in a way that allows the schema to encode non-git source access methods, even if west itself cannot handle anything other than git, in order to avoid a schema compatibility break later. It should also be noted that /some/path and file:///some/path are treated differently by Git - the former is more efficient for remotes on systems which support hard links. So some non-URL encodings may be desirable. |
@tejlmand @carlescufi I found a workaround you might be interested in: |
@tejlmand I am going to close this since west has been available for years and we still haven't discovered a compelling use case for it. |
#615 looks similar. |
Remotes are specified in the manifest as:
remotes:
- name: zephyrproject-rtos
url: https://github.com/zephyrproject-rtos
or
remotes:
- name: zephyrproject-rtos
url: git@github.com:zephyrproject-rtos/zephyr.git
but there cannot be two url for one remote.
the https version is easy to start out with, but often ssh with keys are nicer to work with (imho).
Could it be made possible to maybe be able to specify some like:
remotes:
- name: zephyrproject-rtos
url: https://github.com/zephyrproject-rtos
url-ssh: git@github.com:zephyrproject-rtos/zephyr.git
the type specified under url is used per default but if url-ssh is present and users specify, e.g.
west fetch --ssh
uses url-ssh if present (otherwise fallback is url)
The text was updated successfully, but these errors were encountered: