All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gitlab-ci: Be ready for new default 'main' branch name
@ 2021-05-25 15:38 Philippe Mathieu-Daudé
  2021-05-25 16:08 ` Daniel P. Berrangé
  2021-05-25 16:43 ` Willian Rampazzo
  0 siblings, 2 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-05-25 15:38 UTC (permalink / raw)
  To: qemu-devel
  Cc: Savitoj Singh, Thomas Huth, Daniel P . Berrangé,
	Philippe Mathieu-Daudé, Philippe Mathieu-Daudé,
	Wainer dos Santos Moschetta, Willian Rampazzo, Paolo Bonzini,
	Alex Bennée

In order to be ready for the GitLab changes in using inclusive
terminology (replacing the 'master' branch name by the 'main'
branch name), rename our use of 'master' by the $CI_DEFAULT_BRANCH
environment variable, so new forks won't be facing any issue.

References:

- https://sfconservancy.org/news/2020/jun/23/gitbranchname/
- https://about.gitlab.com/blog/2021/03/10/new-git-default-branch-name/

Suggested-by: Savitoj Singh <savsingh@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 .gitlab-ci.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index f718b61fa78..db4e8490483 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -784,7 +784,7 @@ check-patch:
   script: .gitlab-ci.d/check-patch.py
   except:
     variables:
-      - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
+      - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
   variables:
     GIT_DEPTH: 1000
   allow_failure: true
@@ -797,7 +797,7 @@ check-dco:
   script: .gitlab-ci.d/check-dco.py
   except:
     variables:
-      - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
+      - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
   variables:
     GIT_DEPTH: 1000
 
-- 
2.26.3



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] gitlab-ci: Be ready for new default 'main' branch name
  2021-05-25 15:38 [PATCH] gitlab-ci: Be ready for new default 'main' branch name Philippe Mathieu-Daudé
@ 2021-05-25 16:08 ` Daniel P. Berrangé
  2021-05-25 17:33   ` Philippe Mathieu-Daudé
  2021-05-25 16:43 ` Willian Rampazzo
  1 sibling, 1 reply; 4+ messages in thread
From: Daniel P. Berrangé @ 2021-05-25 16:08 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Savitoj Singh, Thomas Huth, qemu-devel,
	Wainer dos Santos Moschetta, Philippe Mathieu-Daudé,
	Willian Rampazzo, Paolo Bonzini, Alex Bennée

On Tue, May 25, 2021 at 05:38:25PM +0200, Philippe Mathieu-Daudé wrote:
> In order to be ready for the GitLab changes in using inclusive
> terminology (replacing the 'master' branch name by the 'main'
> branch name), rename our use of 'master' by the $CI_DEFAULT_BRANCH
> environment variable, so new forks won't be facing any issue.

I've no objection to the actual config change, but the description is
little inaccurate IMHO. GitLab is not forcing a branch name change
into any existing repositories. It is entirely upto QEMU to decide
when to change our branch names. Forks of QEMU also won't get a new
branch name, because any branches in forks are inherited from what
exists in repository being forked and not arbitrarily renamed.

So, AFAICT, only brand new (ie empty) repositories will get 'main'
as the new default branch name.

IOW, I'd describe this as

  "We want to skip the checkpatch and DCO signoff jobs when
   pushing to the default branch. Currently this branch is
   called 'master', but we don't need to hardcode this in
   the CI configuration, because the $CI_DEFAULT_BRANCH
   env variable exposes it."

> diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
> index f718b61fa78..db4e8490483 100644
> --- a/.gitlab-ci.yml
> +++ b/.gitlab-ci.yml
> @@ -784,7 +784,7 @@ check-patch:
>    script: .gitlab-ci.d/check-patch.py
>    except:
>      variables:
> -      - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
> +      - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
>    variables:
>      GIT_DEPTH: 1000
>    allow_failure: true
> @@ -797,7 +797,7 @@ check-dco:
>    script: .gitlab-ci.d/check-dco.py
>    except:
>      variables:
> -      - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
> +      - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
>    variables:
>      GIT_DEPTH: 1000

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gitlab-ci: Be ready for new default 'main' branch name
  2021-05-25 15:38 [PATCH] gitlab-ci: Be ready for new default 'main' branch name Philippe Mathieu-Daudé
  2021-05-25 16:08 ` Daniel P. Berrangé
@ 2021-05-25 16:43 ` Willian Rampazzo
  1 sibling, 0 replies; 4+ messages in thread
From: Willian Rampazzo @ 2021-05-25 16:43 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Savitoj Singh, Thomas Huth, Daniel P . Berrangé,
	qemu-devel, Wainer dos Santos Moschetta,
	Philippe Mathieu-Daudé,
	Paolo Bonzini, Alex Bennée

On Tue, May 25, 2021 at 12:39 PM Philippe Mathieu-Daudé
<philmd@redhat.com> wrote:
>
> In order to be ready for the GitLab changes in using inclusive
> terminology (replacing the 'master' branch name by the 'main'
> branch name), rename our use of 'master' by the $CI_DEFAULT_BRANCH
> environment variable, so new forks won't be facing any issue.
>
> References:
>
> - https://sfconservancy.org/news/2020/jun/23/gitbranchname/
> - https://about.gitlab.com/blog/2021/03/10/new-git-default-branch-name/
>
> Suggested-by: Savitoj Singh <savsingh@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  .gitlab-ci.yml | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>

With changes to the description proposed by Daniel:

Reviewed-by: Willian Rampazzo <willianr@redhat.com>

> diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
> index f718b61fa78..db4e8490483 100644
> --- a/.gitlab-ci.yml
> +++ b/.gitlab-ci.yml
> @@ -784,7 +784,7 @@ check-patch:
>    script: .gitlab-ci.d/check-patch.py
>    except:
>      variables:
> -      - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
> +      - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
>    variables:
>      GIT_DEPTH: 1000
>    allow_failure: true
> @@ -797,7 +797,7 @@ check-dco:
>    script: .gitlab-ci.d/check-dco.py
>    except:
>      variables:
> -      - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
> +      - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
>    variables:
>      GIT_DEPTH: 1000
>
> --
> 2.26.3
>



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gitlab-ci: Be ready for new default 'main' branch name
  2021-05-25 16:08 ` Daniel P. Berrangé
@ 2021-05-25 17:33   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-05-25 17:33 UTC (permalink / raw)
  To: Daniel P. Berrangé
  Cc: Savitoj Singh, Thomas Huth, qemu-devel,
	Wainer dos Santos Moschetta, Philippe Mathieu-Daudé,
	Willian Rampazzo, Paolo Bonzini, Alex Bennée

On 5/25/21 6:08 PM, Daniel P. Berrangé wrote:
> On Tue, May 25, 2021 at 05:38:25PM +0200, Philippe Mathieu-Daudé wrote:
>> In order to be ready for the GitLab changes in using inclusive
>> terminology (replacing the 'master' branch name by the 'main'
>> branch name), rename our use of 'master' by the $CI_DEFAULT_BRANCH
>> environment variable, so new forks won't be facing any issue.
> 
> I've no objection to the actual config change, but the description is
> little inaccurate IMHO. GitLab is not forcing a branch name change
> into any existing repositories. It is entirely upto QEMU to decide
> when to change our branch names. Forks of QEMU also won't get a new
> branch name, because any branches in forks are inherited from what
> exists in repository being forked and not arbitrarily renamed.

Oh, then I misunderstood the overall change. Thanks for correcting me.

> So, AFAICT, only brand new (ie empty) repositories will get 'main'
> as the new default branch name.
> 
> IOW, I'd describe this as
> 
>   "We want to skip the checkpatch and DCO signoff jobs when
>    pushing to the default branch. Currently this branch is
>    called 'master', but we don't need to hardcode this in
>    the CI configuration, because the $CI_DEFAULT_BRANCH
>    env variable exposes it."

OK, I'll respin, thanks!

>> diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
>> index f718b61fa78..db4e8490483 100644
>> --- a/.gitlab-ci.yml
>> +++ b/.gitlab-ci.yml
>> @@ -784,7 +784,7 @@ check-patch:
>>    script: .gitlab-ci.d/check-patch.py
>>    except:
>>      variables:
>> -      - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
>> +      - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
>>    variables:
>>      GIT_DEPTH: 1000
>>    allow_failure: true
>> @@ -797,7 +797,7 @@ check-dco:
>>    script: .gitlab-ci.d/check-dco.py
>>    except:
>>      variables:
>> -      - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
>> +      - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
>>    variables:
>>      GIT_DEPTH: 1000
> 
> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
> 
> 
> Regards,
> Daniel
> 



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-05-25 17:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-25 15:38 [PATCH] gitlab-ci: Be ready for new default 'main' branch name Philippe Mathieu-Daudé
2021-05-25 16:08 ` Daniel P. Berrangé
2021-05-25 17:33   ` Philippe Mathieu-Daudé
2021-05-25 16:43 ` Willian Rampazzo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.