<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>260624</bug_id>
          
          <creation_ts>2023-08-23 13:23:49 -0700</creation_ts>
          <short_desc>[git-webkit] Pushing a branch to a secure remote prevents it from being pushed publicly</short_desc>
          <delta_ts>2024-03-13 10:07:34 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Tools / Tests</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>239082</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Elliott Williams">emw</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>jbedard</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1973076</commentid>
    <comment_count>0</comment_count>
    <who name="Elliott Williams">emw</who>
    <bug_when>2023-08-23 13:23:49 -0700</bug_when>
    <thetext>I have a second machine configured as a &quot;secure&quot; remote, so that I can push branches I&apos;m working on to it for testing.

If I push any public branch (i.e. a development branch off `main`) to this remote, I can no longer push the branch publicly. For example:

	&gt; git push bolero eng/dont-mutate-sdk-headers-2 -f
	Pushing to bolero, which is classified as a secure remote
	…
	
	# test test test, now it&apos;s time to open a PR
	
	&gt; git webkit pr --no-rebase --no-add
	…
	Pushing to fork, which is classified as a public remote
	Verifying commits in &apos;default&apos; mode
	Attempting to push 1 batch of commits to fork...
	&apos;181f4418c3a3&apos; comes from a more secure remote than &apos;fork&apos;
	error: failed to push some refs to &apos;https://github.com/emw-apple/WebKit.git&apos;
	Failed to push &apos;eng/dont-mutate-sdk-headers-2&apos; to &apos;fork&apos; (alias of &apos;https://github.com/emw-apple/WebKit.git&apos;)
	Your checkout may be mis-configured, try re-running &apos;git-webkit setup&apos; or
	your checkout may not have permission to push to &apos;https://github.com/emw-apple/WebKit.git&apos;

From what I can tell, git-webkit should care about the *content* of the branch, not its presence on other secure remotes. If I delete my tracking branches:

	&gt; git branch -r --contains eng/dont-mutate-sdk-headers-2 | xargs git branch -dr

then I can push successfully.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1974534</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-08-30 13:24:21 -0700</bug_when>
    <thetext>&lt;rdar://problem/114719734&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2020747</commentid>
    <comment_count>2</comment_count>
    <who name="Jonathan Bedard">jbedard</who>
    <bug_when>2024-03-13 10:07:34 -0700</bug_when>
    <thetext>I&apos;m actually going to mark this one as &quot;behaves correctly&quot;.

What&apos;s actually going on here is that you have a remote that doesn&apos;t have a classification, so we consider it to be &quot;secure&quot; when changes are coming from it, but &quot;public&quot; when changes are going to it. By design, `git-webkit` is pretty naive about the content of commits and forbids &quot;promoting&quot; commits from secure remotes to public remotes. There are some situations where this is annoying, but in most cases, this behavior protects contributors from their own (potentially catastrophic) mistakes. There are a couple of work arounds.

- Re-run `git-webkit setup`. If the unclassified remote is a GitHub remote, we can compute its security level, which may be &quot;public&quot;, which will avoid all of this. (we don&apos;t compute security levels during a push because it&apos;s a relatively expensive operation)
- Rebase your PR. The &quot;promotion&quot; design relies exclusively on hashes, it&apos;s really looking for commits landed on a production branch which won&apos;t be rebased</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>