8000 Change default protocol by halostatue · Pull Request #2939 · mislav/hub · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Change default protocol #2939

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

Merged
merged 10 commits into from
Mar 25, 2022
Merged

Change default protocol #2939

merged 10 commits into from
Mar 25, 2022

Conversation

halostatue
Copy link
Contributor

Resolves #2937

  • When HUB_PROTOCOL or hub.protocol are not specified, default to https instead of git, which has been deprecated by GitHub.

    $ hub clone github/hub
    Cloning into 'hub'...
    fatal: remote error:
      The unauthenticated git protocol on port 9418 is no longer supported.
    Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information.

Explicitly setting hub.protocol to git or using HUB_PROTOCOL=git still uses the git protocol.

Note that I have not updated any documentation because the default does not appear to be documented anywhere, only overriding to use git config --global hub.protocol ssh or git config --global hub.protocol https. Now to use the (deprecated) default, one should use git config --global hub.protocol git.

Resolves #2937

- When `HUB_`PROTOCOL or `hub.protocol` are not specified, default to
  `https` instead of `git`, which has been deprecated by GitHub.

  ```sh
  $ hub clone github/hub
  Cloning into 'hub'...
  fatal: remote error:
    The unauthenticated git protocol on port 9418 is no longer supported.
  Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information.
  ```

Explicitly setting `hub.protocol` to `git` or using `HUB_PROTOCOL=git`
still uses the `git` protocol.
@halostatue
Copy link
Contributor Author

I am adding additional commits to fix the features, but note that the following feature is failing on master when run with script/docker (I am getting an install error from the ffi gem on my M1 MBP):

❯ script/docker features/fork.feature
[+] Building 0.3s (14/14) FINISHED
 => [internal] load build definition from Dockerfile                                                             0.0s
 => => transferring dockerfile: 37B                                                                              0.0s
 => [internal] load .dockerignore                                                                                0.0s
 => => transferring context: 34B                                                                                 0.0s
 => [internal] load metadata for docker.io/library/ruby:2.6                                                      0.3s
 => [1/9] FROM docker.io/library/ruby:2.6@sha256:264b256e8d4a0b18964c0c1797cf8f2ec09c420238b52daeef3ea7c12dd84d  0.0s
 => [internal] load build context                                                                                0.0s
 => => transferring context: 60B                                                                                 0.0s
 => CACHED [2/9] RUN apt-get update  && apt-get install -y sudo golang --no-install-recommends                   0.0s
 => CACHED [3/9] RUN apt-get purge --auto-remove -y curl  && rm -rf /var/lib/apt/lists/*                         0.0s
 => CACHED [4/9] RUN groupadd -r app && useradd -r -g app -G sudo app  && mkdir -p /home/app && chown -R app:ap  0.0s
 => CACHED [5/9] RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers                                         0.0s
 => CACHED [6/9] RUN bundle config --global frozen 1                                                             0.0s
 => CACHED [7/9] WORKDIR /home/app/workdir                                                                       0.0s
 => CACHED [8/9] COPY Gemfile Gemfile.lock ./                                                                    0.0s
 => CACHED [9/9] RUN bundle install                                                                 
8000
             0.0s
 => exporting to image                                                                                           0.0s
 => => exporting layers                                                                                          0.0s
 => => writing image sha256:533bd46d397bc7c9e25d6f90458a5768cdecffcb5cab46a603faef8f8b6e81f7                     0.0s
 => => naming to docker.io/library/hub-test                                                                      0.0s

Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them
go: downloading github.com/russross/blackfriday v0.0.0-20180526075726-670777b536d3
go: downloading github.com/google/go-cmp v0.4.0
go: downloading github.com/mattn/go-isatty v0.0.3
go: downloading github.com/mattn/go-colorable v0.0.9
go: downloading github.com/kballard/go-shellquote v0.0.0-20170619183022-cd60e84ee657
go: downloading github.com/mitchellh/go-homedir v0.0.0-20161203194507-b8bc1bf76747
go: downloading golang.org/x/net v0.0.0-20191002035440-2ec189313ef0
go: downloading golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2
go: downloading github.com/BurntSushi/toml v0.3.0
go: downloading github.com/atotto/clipboard v0.0.0-20171229224153-bc5958e1c833
go: downloading gopkg.in/yaml.v2 v2.0.0-20190319135612-7b8349ac747c
go: downloading github.com/shurcooL/sanitized_anchor_name v0.0.0-20170918181015-86672fcb3f95
go: downloading golang.org/x/text v0.3.0
go: downloading golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2
?   	github.com/github/hub/v2	[no test files]
ok  	github.com/github/hub/v2/cmd	0.012s
ok  	github.com/github/hub/v2/commands	0.042s
?   	github.com/github/hub/v2/coverage	[no test files]
?   	github.com/github/hub/v2/fixtures	[no test files]
ok  	github.com/github/hub/v2/git	0.356s
ok  	github.com/github/hub/v2/github	0.388s
?   	github.com/github/hub/v2/internal/assert	[no test files]
?   	github.com/github/hub/v2/md2roff	[no test files]
?   	github.com/github/hub/v2/md2roff-bin	[no test files]
ok  	github.com/github/hub/v2/ui	0.002s
ok  	github.com/github/hub/v2/utils	0.002s
?   	github.com/github/hub/v2/version	[no test files]
Using the default profile...
.................................................................................F--.................................................................................

(::) failed steps (::)

expected that command "hub fork" has exit status of "128", but has "3". (RSpec::Expectations::ExpectationNotMetError)
features/fork.feature:174:in `Then the exit status should be 128'

Failing Scenarios:
cucumber features/fork.feature:162 # Scenario: Unrelated remote already exists

20 scenarios (1 failed, 19 passed)
165 steps (1 failed, 2 skipped, 162 passed)
0m0.892s

I am getting the same error on local runs of this branch, so I am not changing this feature.

@mislav mislav merged commit c4af574 into mislav:master Mar 25, 2022
@mislav
Copy link
Owner
mislav commented Mar 25, 2022
8000

Thank you! I've fixed CI and pushed additional changes to fully finalize the switch to HTTPS as default, including the documentation.

@paulwratt
Copy link

is there any reason why this doesn't qualify for another release, seems pretty critical to me (unless something else is hold that up or blocking)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

hub clone $org/$repo failing after GitHub deprecates git:// URLs
3 participants
0