#303 Add support for a 'flatpaks' namespace
Merged 5 years ago by onosek. Opened 5 years ago by otaylor.
otaylor/fedpkg flatpaks-namespace  into  master

@@ -14,7 +14,7 @@ 

    bz.default-component %(repo)s

    sendemail.to %(repo)s-owner@fedoraproject.org

  distgit_namespaced = True

- distgit_namespaces = rpms container modules

+ distgit_namespaces = rpms container modules flatpaks

  lookaside_namespaced = True

  kerberos_realms = STG.FEDORAPROJECT.ORG

  oidc_id_provider = https://id.stg.fedoraproject.org/openidc/

file modified
+1 -1
@@ -14,7 +14,7 @@ 

    bz.default-component %(repo)s

    sendemail.to %(repo)s-owner@fedoraproject.org

  distgit_namespaced = True

- distgit_namespaces = rpms container modules

+ distgit_namespaces = rpms container modules flatpaks

  lookaside_namespaced = True

  kerberos_realms = FEDORAPROJECT.ORG

  oidc_id_provider = https://id.fedoraproject.org/openidc/

file modified
+5 -5
@@ -803,7 +803,7 @@ 

          # bug is not a required parameter in the event the packager has an

          # exception, in which case, they may use the --exception flag

          # neither in case of modules, which don't require a formal review

-         if not bug and not exception and ns not in ['tests', 'modules']:

+         if not bug and not exception and ns not in ['tests', 'modules', 'flatpaks']:

              raise rpkgError(

                  'A Bugzilla bug is required on new repository requests')

          repo_regex = r'^[a-zA-Z0-9_][a-zA-Z0-9-_.+]*$'
@@ -816,7 +816,7 @@ 

                  .format(repo_name))

  

          summary_from_bug = ''

-         if bug and ns not in ['tests', 'modules']:

+         if bug and ns not in ['tests', 'modules', 'flatpaks']:

              bz_url = config.get('{0}.bugzilla'.format(name), 'url')

              bz_client = BugzillaClient(bz_url)

              bug_obj = bz_client.get_review_bug(bug, ns, repo_name)
@@ -929,13 +929,13 @@ 

              if is_epel(branch):

                  assert_valid_epel_package(repo_name, branch)

  

-             if ns in ['modules', 'test-modules']:

+             if ns in ['modules', 'test-modules', 'flatpaks']:

                  branch_valid = bool(re.match(r'^[a-zA-Z0-9.\-_+]+$', branch))

                  if not branch_valid:

                      raise rpkgError(

                          'Only characters, numbers, periods, dashes, '

-                         'underscores, and pluses are allowed in module branch '

-                         'names')

+                         'underscores, and pluses are allowed in {} branch '

+                         'names'.format('flatpak' if ns == 'flatpaks' else 'module'))

              release_branches = list(itertools.chain(

                  *list(get_release_branches(pdc_url).values())))

              if branch in release_branches:

file modified
+16
@@ -1223,6 +1223,22 @@ 

          except rpkgError as error:

              self.assertEqual(str(error), expected_error)

  

+     def test_request_branch_invalid_flatpak_branch_name(self):

+         """Test request-branch raises an exception when a invalid module branch

+         name is supplied"""

+         cli_cmd = ['fedpkg-stage', '--path', self.cloned_repo_path,

+                    '--name', 'nethack', '--namespace', 'flatpaks',

+                    'request-branch', 'some:branch']

+         cli = self.get_cli(cli_cmd)

+         expected_error = (

+             'Only characters, numbers, periods, dashes, underscores, and '

+             'pluses are allowed in flatpak branch names')

+         try:

+             cli.request_branch()

+             assert False, 'rpkgError not raised'

+         except rpkgError as error:

+             self.assertEqual(str(error), expected_error)

+ 

      def test_request_branch_no_branch(self):

          """Test request-branch raises an exception when a branch isn't supplied

          """

flatpaks/ will be added as a separate namespace in Fedora distgit - see:

https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/LOLYI2FHGCVJ7EKC6NB3CZ3ACBRKQFCK/

The handling will be like modules/ - where flatpaks are currently:
- No bugzilla bug is required for repository creation
- Branch names must be valid module stream names

Signed-off-by: Owen W. Taylor otaylor@fishsoup.net

Pull-Request has been merged by onosek

5 years ago