Merge ~skia/git-ubuntu:skia/fix_submit into git-ubuntu:main
- Git
- lp:~skia/git-ubuntu
- skia/fix_submit
- Merge into main
| Status: | Needs review |
|---|---|
| Proposed branch: | ~skia/git-ubuntu:skia/fix_submit |
| Merge into: | git-ubuntu:main |
| Diff against target: |
310 lines (+110/-66) 5 files modified
gitubuntu/git_repository.py (+26/-39) gitubuntu/git_repository_test.py (+65/-20) gitubuntu/submit.py (+11/-6) snap.sh (+1/-1) snap/snapcraft.yaml (+7/-0) |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Server Team CI bot | continuous-integration | Approve | |
| Robie Basak | Needs Fixing | ||
|
Review via email:
|
|||
Commit message
Description of the change
These three commits are helping out `git ubuntu submit` move out of "EXPERIMENTAL".
It makes its default behavior to just work when submitting a simple change to the `devel` release, without any flag required.
I don't know yet about submitting changes against stable series, that remains to be tested.
| Server Team CI bot (server-team-bot) wrote : | # |
| Server Team CI bot (server-team-bot) wrote : | # |
FAILED: Continuous integration, rev:2877d13537a
https:/
Executed test runs:
SUCCESS: VM Setup
SUCCESS: Clone
SUCCESS: Build
SUCCESS: VM Reset
FAILED: Unit Tests
Click here to trigger a rebuild:
https:/
| Skia (skia) wrote : | # |
This time the CI failure seems to be on the infra:
```
+ uvt-kvm ssh --insecure gitubuntu-ci-86 -- bash -l -c git-ubuntu.
/snap/git-
```
| Robie Basak (racb) wrote : | # |
Please fix CI before landing this!
Thank you for working on this! Comments inline.
- c977f4b... by Skia
-
Add a test for 'nearest_
remote_ branches' This test currently fails, the fix is in the next commit.
| Server Team CI bot (server-team-bot) wrote : | # |
FAILED: Continuous integration, rev:85fd7a9fbcb
https:/
Executed test runs:
SUCCESS: VM Setup
SUCCESS: Clone
SUCCESS: Build
SUCCESS: VM Reset
FAILED: Unit Tests
Click here to trigger a rebuild:
https:/
- 03b8bb7... by Skia
-
snap: add more metadata
Silences the following linter outputs:
metadata: Metadata field '<field>' is missing or empty. - 7d6c0a8... by Skia
-
snap: explicitely call the 'pack' subcommand
Silences the following warning:
Running snapcraft without a command will not be possible in future releases. Use 'snapcraft pack' instead. - 7201004... by Skia
-
Revert "snap: Drop git-ubuntu as a stage-package"
This reverts commit 6684cf84050058a
9f77e404240e836 1947f5f42d. This is a WIP to test if CI works or not. Clearly, not having the
`git-ubuntu` package installed breaks the snap, and thus the tests,
because `git-ubuntu.self-test` can't work.
Let's investigate deeper why the build failed at the time of this
commit.
| Server Team CI bot (server-team-bot) wrote : | # |
PASSED: Continuous integration, rev:3c8c569ec46
https:/
Executed test runs:
SUCCESS: VM Setup
SUCCESS: Clone
SUCCESS: Build
SUCCESS: VM Reset
SUCCESS: Unit Tests
IN_PROGRESS: Declarative: Post Actions
Click here to trigger a rebuild:
https:/
- 908a34d... by Skia
-
git_repository: rework '_derive_
target_ branch_ string' API Since `pygit2.Branch` is not hash-able (anymore?), the use of `set()`
was removed a couple of commits ago, with a very limited set of changes
to avoid changing the API too much.
This commit now introduces a bigger rework, to actually get rid of the
"deduplicated list" hack by using a `dict`.
Thanks @rbasak for the data structure suggestion! - 5b1dd31... by Skia
-
git_repository_
test: improve coverage of '_derive_ target_ branch_ string' * Add the few edge cases that weren't covered
* Add the checks on the logging, better showing all the edge cases
| Skia (skia) wrote : | # |
@rbasak: With the last two commits, I believe all your comments are addressed. This MP now comes with multiple additional improvements in both the snap packaging and the tests. See individual commit logs for details.
| Server Team CI bot (server-team-bot) wrote : | # |
PASSED: Continuous integration, rev:2f18e083d0d
https:/
Executed test runs:
SUCCESS: VM Setup
SUCCESS: Clone
SUCCESS: Build
SUCCESS: VM Reset
SUCCESS: Unit Tests
IN_PROGRESS: Declarative: Post Actions
Click here to trigger a rebuild:
https:/
| Robie Basak (racb) wrote : | # |
This is looking good! I don't have time to give this a full review, but I noticed some bits that I hope will help make progress. Comments inline.
I also can't see why your snap packaging related commits aren't showing up in https:/
| Robie Basak (racb) wrote : | # |
> I also can't see why your snap packaging related commits aren't showing up in https:/
Ah, because the /gitubuntu at the end was masking it.
- e262e35... by Skia
-
git_repository: rework '_derive_
target_ branch_ string' API to raise upon errors Previous API was returning an empty string and logging out directly.
That's not a good pattern for a library module.
New API raises a specific exception instead, and let the caller do the
logging itself. This makes the return value of the function to always be
a valid one when the function returns normally.
| Skia (skia) wrote : | # |
I've answered inline, and fixed what could be fixed.
| Server Team CI bot (server-team-bot) wrote : | # |
PASSED: Continuous integration, rev:e262e356fbe
https:/
Executed test runs:
SUCCESS: VM Setup
SUCCESS: Clone
SUCCESS: Build
SUCCESS: VM Reset
SUCCESS: Unit Tests
IN_PROGRESS: Declarative: Post Actions
Click here to trigger a rebuild:
https:/
Unmerged commits
- e262e35... by Skia
-
git_repository: rework '_derive_
target_ branch_ string' API to raise upon errors Previous API was returning an empty string and logging out directly.
That's not a good pattern for a library module.
New API raises a specific exception instead, and let the caller do the
logging itself. This makes the return value of the function to always be
a valid one when the function returns normally. - 5b1dd31... by Skia
-
git_repository_
test: improve coverage of '_derive_ target_ branch_ string' * Add the few edge cases that weren't covered
* Add the checks on the logging, better showing all the edge cases - 908a34d... by Skia
-
git_repository: rework '_derive_
target_ branch_ string' API Since `pygit2.Branch` is not hash-able (anymore?), the use of `set()`
was removed a couple of commits ago, with a very limited set of changes
to avoid changing the API too much.
This commit now introduces a bigger rework, to actually get rid of the
"deduplicated list" hack by using a `dict`.
Thanks @rbasak for the data structure suggestion! - 7201004... by Skia
-
Revert "snap: Drop git-ubuntu as a stage-package"
This reverts commit 6684cf84050058a
9f77e404240e836 1947f5f42d. This is a WIP to test if CI works or not. Clearly, not having the
`git-ubuntu` package installed breaks the snap, and thus the tests,
because `git-ubuntu.self-test` can't work.
Let's investigate deeper why the build failed at the time of this
commit. - 7d6c0a8... by Skia
-
snap: explicitely call the 'pack' subcommand
Silences the following warning:
Running snapcraft without a command will not be possible in future releases. Use 'snapcraft pack' instead. - 03b8bb7... by Skia
-
snap: add more metadata
Silences the following linter outputs:
metadata: Metadata field '<field>' is missing or empty. - 5838624... by Skia
-
submit: fix the auto-discovery of the devel branch
LP: #1756088
When submitting a simple patch against `ubuntu/devel`, the
auto-discovery mechanism was broken because of the prepended `pkg/`.
Stripping it as for other cases in the function makes the `git ubuntu
submit` command to just work™ in that case. - d5a52f1... by Skia
-
submit: fix traceback when finding target branch
LP: #2087340
On a dead simple call of `git ubuntu submit`:
```
❯ git ubuntu submit
['ubuntu-sponsors']
Traceback (most recent call last):
File "/snap/git-ubuntu/ 2124/usr/ bin/git- ubuntu" , line 33, in <module>
sys.exit(load_ entry_point( 'gitubuntu= =1.2', 'console_scripts', 'git-ubuntu')())
^ ^^^^^^^ ^^^^^^^ ^^^^^^^ ^^^^^^^ ^^^^^^^ ^^^^^^^ ^^^^^^^ ^^^^^^^ ^^^^^^^ ^^^^^
File "/snap/git-ubuntu/ 2124/usr/ lib/python3/ dist-packages/ gitubuntu/ __main_ _.py", line 270, in main
sys.exit(args. func(args) )
^ ^^^^^^^ ^^^^^^^
File "/snap/git-ubuntu/ 2124/usr/ lib/python3/ dist-packages/ gitubuntu/ submit. py", line 77, in cli_main
return main(
^^^^^
File "/snap/git-ubuntu/ 2124/usr/ lib/python3/ dist-packages/ gitubuntu/ submit. py", line 160, in main
target_head_string = derive_ target_ branch(
^^^ ^^^^^^^ ^^^^^^^ ^^^^
File "/snap/git-ubuntu/ 2124/usr/ lib/python3/ dist-packages/ gitubuntu/ git_repository. py", line 232, in derive_ target_ branch
repo.nearest_ remote_ branches( commitish_ string, namespace)
File "/snap/git-ubuntu/ 2124/usr/ lib/python3/ dist-packages/ gitubuntu/ git_repository. py", line 2154, in nearest_ remote_ branches
remote_heads_by_ commit[ b.peel( ).id].add( b)
TypeError: unhashable type: '_pygit2.Branch'
```This commit trades the use of a `set` for the use of a `list` with
manual deduplication (because `pygit2.Branch` isn't hashable, thus can't
be added to a set). That way, only the containing data type is changed,
but the contract on what data to expect is kept.
This probably isn't the most elegant fix, but it's a fix that doesn't
require digging deep into the git-ubuntu API, so I'm fairly confident
this is only improving things, and not breaking too many other use-cases
that I don't know about. - c977f4b... by Skia
-
Add a test for 'nearest_
remote_ branches' This test currently fails, the fix is in the next commit.
Preview Diff
| 1 | diff --git a/gitubuntu/git_repository.py b/gitubuntu/git_repository.py |
| 2 | index a447293..52702b3 100644 |
| 3 | --- a/gitubuntu/git_repository.py |
| 4 | +++ b/gitubuntu/git_repository.py |
| 5 | @@ -164,34 +164,29 @@ def _derive_git_cli_env( |
| 6 | return env |
| 7 | |
| 8 | |
| 9 | -def _derive_target_branch_string(remote_branch_objects): |
| 10 | - '''Given a list of branch objects, return the name of the one to use as the target branch |
| 11 | +class TargetBranchError(Exception): |
| 12 | + pass |
| 13 | + |
| 14 | + |
| 15 | +def _derive_target_branch_string(remote_branch_dict: dict[str, pygit2.Branch]): |
| 16 | + '''Given a dict of branch_name: branch objects, return the name of the one |
| 17 | + to use as the target branch |
| 18 | |
| 19 | Returns either one of the branch objects' names, or the empty string |
| 20 | to indicate no suitable candidate. |
| 21 | ''' |
| 22 | - if len(remote_branch_objects) == 0: |
| 23 | - logging.error("Unable to automatically determine importer " |
| 24 | - "branch: No candidate branches found." |
| 25 | - ) |
| 26 | - return '' |
| 27 | - remote_branch_strings = [ |
| 28 | - b.branch_name for b in remote_branch_objects |
| 29 | - ] |
| 30 | - if len(remote_branch_objects) > 1: |
| 31 | + if len(remote_branch_dict) == 0: |
| 32 | + raise TargetBranchError("No candidate branch found.") |
| 33 | + remote_branch_strings = list(remote_branch_dict.keys()) |
| 34 | + if len(remote_branch_dict) > 1: |
| 35 | # do the trees of each branch's tip match? |
| 36 | if len( |
| 37 | - set(b.peel(pygit2.Tree).id for b in remote_branch_objects) |
| 38 | + set(b.peel(pygit2.Tree).id for b in remote_branch_dict.values()) |
| 39 | ) != 1: |
| 40 | - logging.error("Unable to automatically determine importer " |
| 41 | - "branch: Multiple candidate branches found and " |
| 42 | + raise TargetBranchError("Multiple candidate branches found and " |
| 43 | "their trees do not match: %s. This might be a " |
| 44 | "bug in `git ubuntu lint`, please report it at " |
| 45 | - "https://bugs.launchpad.net/git-ubuntu. " |
| 46 | - "Please pass --target-branch.", |
| 47 | - ", ".join(remote_branch_strings) |
| 48 | - ) |
| 49 | - return '' |
| 50 | + "https://bugs.launchpad.net/git-ubuntu. " % ", ".join(remote_branch_strings)) |
| 51 | # is ubuntu/devel one of the candidates? |
| 52 | try: |
| 53 | return [ |
| 54 | @@ -207,20 +202,12 @@ def _derive_target_branch_string(remote_branch_objects): |
| 55 | b in remote_branch_strings |
| 56 | ) |
| 57 | if len(pkg_remote_branch_serieses) != 1: |
| 58 | - logging.error("Unable to automatically determine importer " |
| 59 | - "branch: Multiple candidate branches found and " |
| 60 | - "they do not target the same series: %s. Please pass " |
| 61 | - "--target-branch.", ", ".join(remote_branch_strings) |
| 62 | - ) |
| 63 | - return '' |
| 64 | + raise TargetBranchError("Multiple candidate branches found and " |
| 65 | + "they do not target the same series: %s." % ", ".join(remote_branch_strings)) |
| 66 | # is a -devel branch present? |
| 67 | if not any('-devel' in b for b in remote_branch_strings): |
| 68 | - logging.error("Unable to automatically determine importer " |
| 69 | - "branch: Multiple candidate branches found and " |
| 70 | - "none appear to be a -devel branch: %s. Please " |
| 71 | - "pass --target-branch.", ", ".join(remote_branch_strings) |
| 72 | - ) |
| 73 | - return '' |
| 74 | + raise TargetBranchError("Multiple candidate branches found and " |
| 75 | + "none appear to be a -devel branch: %s." % ", ".join(remote_branch_strings)) |
| 76 | # if so, favor -devel |
| 77 | remote_branch_strings = [ |
| 78 | b for b in remote_branch_strings if '-devel' in b |
| 79 | @@ -2130,14 +2117,14 @@ class GitUbuntuRepository: |
| 80 | |
| 81 | def nearest_remote_branches(self, commit_hash, prefix=None, |
| 82 | max_commits=100 |
| 83 | - ): |
| 84 | - '''Return the set of remote branches nearest to @commit_hash |
| 85 | + ) -> dict[str, pygit2.Branch]: |
| 86 | + '''Return a dict of remote branches nearest to @commit_hash |
| 87 | |
| 88 | - This is a set of remote branch objects that are currently |
| 89 | + This is a dict of remote branch objects that are currently |
| 90 | pointing at a commit, where that commit is the nearest ancestor |
| 91 | to @commit_hash among the possible commits. |
| 92 | |
| 93 | - If no such commit is found, an empty set is returned. |
| 94 | + If no such commit is found, an empty dict is returned. |
| 95 | |
| 96 | Only consider remote branches that start with @prefix. |
| 97 | |
| 98 | @@ -2148,10 +2135,10 @@ class GitUbuntuRepository: |
| 99 | ''' |
| 100 | |
| 101 | # 1) cache all prefixed branch names by commit |
| 102 | - remote_heads_by_commit = collections.defaultdict(set) |
| 103 | + remote_heads_by_commit = collections.defaultdict(dict) |
| 104 | for b in self.remote_branches: |
| 105 | if prefix is None or b.branch_name.startswith(prefix): |
| 106 | - remote_heads_by_commit[b.peel().id].add(b) |
| 107 | + remote_heads_by_commit[b.peel().id][b.branch_name] = b |
| 108 | |
| 109 | # 2) walk from commit_hash backwards until a cached commit is found |
| 110 | commits = self.raw_repo.walk( |
| 111 | @@ -2166,10 +2153,10 @@ class GitUbuntuRepository: |
| 112 | return remote_heads_by_commit[commit.id] |
| 113 | |
| 114 | # in the currently impossible (but permitted in this state) case |
| 115 | - # that the dictionary returned an empty set, we loop around again |
| 116 | + # that the dictionary returned an empty dict, we loop around again |
| 117 | # which is what we want. |
| 118 | |
| 119 | - return set() |
| 120 | + return dict() |
| 121 | |
| 122 | |
| 123 | def nearest_tag( |
| 124 | diff --git a/gitubuntu/git_repository_test.py b/gitubuntu/git_repository_test.py |
| 125 | index 00c62ba..66f6a20 100644 |
| 126 | --- a/gitubuntu/git_repository_test.py |
| 127 | +++ b/gitubuntu/git_repository_test.py |
| 128 | @@ -31,36 +31,41 @@ from gitubuntu.test_fixtures import ( |
| 129 | from gitubuntu.test_util import get_test_changelog |
| 130 | |
| 131 | |
| 132 | -@pytest.mark.parametrize('same_remote_branch_names, different_remote_branch_names, expected', [ |
| 133 | - ([], [], ''), |
| 134 | - (['pkg/ubuntu/xenial-devel',], [], 'pkg/ubuntu/xenial-devel'), |
| 135 | - (['pkg/ubuntu/xenial-security',], [], 'pkg/ubuntu/xenial-security'), |
| 136 | - (['pkg/ubuntu/xenial-updates', 'pkg/ubuntu/xenial-devel'], [], |
| 137 | - 'pkg/ubuntu/xenial-devel' |
| 138 | - ), |
| 139 | - ([], ['pkg/ubuntu/xenial-updates', 'pkg/ubuntu/xenial-devel'], |
| 140 | - '' |
| 141 | - ), |
| 142 | - (['pkg/ubuntu/zesty-devel', 'pkg/ubuntu/zesty-proposed', 'pkg/ubuntu/devel'], [], 'pkg/ubuntu/devel'), |
| 143 | +@pytest.mark.parametrize('same_remote_branch_names, different_remote_branch_names, expected, expected_log', [ |
| 144 | + ([], [], None, 'No candidate branches found'), |
| 145 | + (['pkg/ubuntu/xenial-devel',], [], 'pkg/ubuntu/xenial-devel', ''), |
| 146 | + (['pkg/ubuntu/xenial-security',], [], 'pkg/ubuntu/xenial-security', ''), |
| 147 | + (['pkg/ubuntu/xenial-updates', 'pkg/ubuntu/xenial-devel'], [], 'pkg/ubuntu/xenial-devel' , ''), |
| 148 | + ([], ['pkg/ubuntu/xenial-updates', 'pkg/ubuntu/xenial-devel'], None, 'Multiple candidate branches found and their trees do not match'), |
| 149 | + (['pkg/ubuntu/zesty-devel', 'pkg/ubuntu/zesty-proposed', 'pkg/ubuntu/devel'], [], 'pkg/ubuntu/devel', ''), |
| 150 | + (['pkg/ubuntu/zesty-updates', 'pkg/ubuntu/zesty-proposed'], [], None, 'Multiple candidate branches found and none appear to be a -devel branch'), |
| 151 | + (['pkg/ubuntu/xenial-devel', 'pkg/ubuntu/focal-devel'], [], None, 'Multiple candidate branches found and they do not target the same series'), |
| 152 | ]) |
| 153 | -def test__derive_target_branch_string(same_remote_branch_names, |
| 154 | - different_remote_branch_names, expected |
| 155 | +def test__derive_target_branch_string(caplog, same_remote_branch_names, |
| 156 | + different_remote_branch_names, expected, expected_log |
| 157 | ): |
| 158 | - remote_branch_objects = [] |
| 159 | + remote_branch_objects = {} |
| 160 | for branch_name in same_remote_branch_names: |
| 161 | b = unittest.mock.Mock() |
| 162 | b.peel(pygit2.Tree).id = unittest.mock.sentinel.same_id |
| 163 | b.branch_name = branch_name |
| 164 | - remote_branch_objects.append(b) |
| 165 | + remote_branch_objects[branch_name] = b |
| 166 | for branch_name in different_remote_branch_names: |
| 167 | b = unittest.mock.Mock() |
| 168 | b.peel(pygit2.Tree).id = object() # need a different sentinel for each |
| 169 | b.branch_name = branch_name |
| 170 | - remote_branch_objects.append(b) |
| 171 | - target_branch_string = target._derive_target_branch_string( |
| 172 | - remote_branch_objects |
| 173 | - ) |
| 174 | - assert target_branch_string == expected |
| 175 | + remote_branch_objects[branch_name] = b |
| 176 | + if expected: |
| 177 | + target_branch_string = target._derive_target_branch_string( |
| 178 | + remote_branch_objects |
| 179 | + ) |
| 180 | + assert target_branch_string == expected |
| 181 | + else: |
| 182 | + with pytest.raises(target.TargetBranchError) as e: |
| 183 | + target._derive_target_branch_string( |
| 184 | + remote_branch_objects |
| 185 | + ) |
| 186 | + assert expected_log in str(e) |
| 187 | |
| 188 | |
| 189 | @pytest.mark.parametrize('changelog_name, expected', [ |
| 190 | @@ -1265,3 +1270,43 @@ def test_create_tracking_branch_tracks(repo, pygit2_repo): |
| 191 | ) |
| 192 | assert repo.raw_repo.config['branch.main.remote'] == 'origin' |
| 193 | assert repo.raw_repo.config['branch.main.merge'] == 'refs/heads/main' |
| 194 | + |
| 195 | + |
| 196 | +def test_nearest_remote_branches(repo, pygit2_repo): |
| 197 | + # Note that we cannot use a repo instance twice, because pytest will give |
| 198 | + # us only one instance. A convenient workaround is that the remote repo |
| 199 | + # doesn't need to be a GitUbuntuRepository and so the pygit2_repo fixture |
| 200 | + # will do as it is independent. We can assert they are definitely |
| 201 | + # different: |
| 202 | + assert repo.raw_repo is not pygit2_repo |
| 203 | + base_repo = Repo( |
| 204 | + commits=[ |
| 205 | + Commit(name='first'), |
| 206 | + Commit(name='second', parents=[Placeholder('first')]), |
| 207 | + ], |
| 208 | + branches={ |
| 209 | + 'ubuntu/devel': Placeholder('first'), |
| 210 | + 'ubuntu/resolute': Placeholder('first'), |
| 211 | + 'ubuntu/devel-proposed': Placeholder('second'), |
| 212 | + 'ubuntu/resolute-proposed': Placeholder('second'), |
| 213 | + }, |
| 214 | + ) |
| 215 | + base_repo.write(pygit2_repo) |
| 216 | + local_repo = base_repo.copy( |
| 217 | + add_commits=[ |
| 218 | + Commit.from_spec( |
| 219 | + parents=[Placeholder('second')], |
| 220 | + name='third', |
| 221 | + ), |
| 222 | + ], |
| 223 | + update_branches={'new-feature': Placeholder('third')} |
| 224 | + ) |
| 225 | + local_repo.write(repo.raw_repo) |
| 226 | + |
| 227 | + repo.raw_repo.remotes.create('origin', pygit2_repo.path) |
| 228 | + repo.git_run(['fetch', 'origin']) |
| 229 | + |
| 230 | + commit = repo.raw_repo.references['refs/heads/new-feature'].peel(pygit2.Commit) |
| 231 | + branch = repo.nearest_remote_branches(str(commit.id)) |
| 232 | + assert len(branch.keys()) == 2 |
| 233 | + assert list(branch.keys()) == ["origin/ubuntu/devel-proposed", "origin/ubuntu/resolute-proposed"] |
| 234 | diff --git a/gitubuntu/submit.py b/gitubuntu/submit.py |
| 235 | index 41ef4b5..0a80465 100644 |
| 236 | --- a/gitubuntu/submit.py |
| 237 | +++ b/gitubuntu/submit.py |
| 238 | @@ -12,6 +12,7 @@ from gitubuntu.git_repository import ( |
| 239 | derive_target_branch, |
| 240 | GitUbuntuRepository, |
| 241 | git_dep14_tag, |
| 242 | + TargetBranchError, |
| 243 | ) |
| 244 | from gitubuntu.run import decode_binary, run |
| 245 | from gitubuntu.source_information import GitUbuntuSourceInformation, launchpad_login_auth |
| 246 | @@ -157,12 +158,15 @@ def main( |
| 247 | namespace = 'pkg' |
| 248 | else: |
| 249 | namespace = target_user |
| 250 | - target_head_string = derive_target_branch( |
| 251 | - repo, |
| 252 | - commitish_string, |
| 253 | - namespace, |
| 254 | - ) |
| 255 | - if len(target_head_string) == 0: |
| 256 | + try: |
| 257 | + target_head_string = derive_target_branch( |
| 258 | + repo, |
| 259 | + commitish_string, |
| 260 | + namespace, |
| 261 | + ) |
| 262 | + except TargetBranchError as e: |
| 263 | + logging.error("Unable to automatically determine importer branch: %s\n" |
| 264 | + "Please pass --target-branch.", str(e)) |
| 265 | return 1 |
| 266 | |
| 267 | logging.debug("target branch: %s", target_head_string) |
| 268 | @@ -202,6 +206,7 @@ def main( |
| 269 | ) |
| 270 | return 1 |
| 271 | |
| 272 | + target_head_string = target_head_string.removeprefix("pkg/") |
| 273 | target_git_ref = target_git_repo.getRefByPath( |
| 274 | path='refs/heads/%s' % target_head_string |
| 275 | ) |
| 276 | diff --git a/snap.sh b/snap.sh |
| 277 | index 7817f56..8159cbe 100644 |
| 278 | --- a/snap.sh |
| 279 | +++ b/snap.sh |
| 280 | @@ -104,4 +104,4 @@ EOT |
| 281 | # Build the snap itself |
| 282 | # Using sudo as a workaround for |
| 283 | # https://github.com/canonical/snapcraft/issues/5113 |
| 284 | -sudo snapcraft --destructive-mode |
| 285 | +sudo snapcraft pack --destructive-mode --verbosity verbose |
| 286 | diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml |
| 287 | index ee08a80..96854db 100644 |
| 288 | --- a/snap/snapcraft.yaml |
| 289 | +++ b/snap/snapcraft.yaml |
| 290 | @@ -2,6 +2,12 @@ name: git-ubuntu |
| 291 | version: git |
| 292 | summary: Ubuntu development git tooling |
| 293 | description: Maintain an Ubuntu source package in a git tree |
| 294 | +title: git-ubuntu |
| 295 | +source-code: [ https://code.launchpad.net/~git-ubuntu-dev/git-ubuntu/+git/git-ubuntu ] |
| 296 | +contact: [ https://launchpad.net/~git-ubuntu-dev ] |
| 297 | +license: GPL-3.0 |
| 298 | +issues: [ https://bugs.launchpad.net/git-ubuntu ] |
| 299 | +website: [ https://launchpad.net/git-ubuntu ] |
| 300 | confinement: classic |
| 301 | grade: stable |
| 302 | base: core24 |
| 303 | @@ -64,6 +70,7 @@ parts: |
| 304 | - findutils |
| 305 | - git |
| 306 | - git-buildpackage |
| 307 | + - git-ubuntu |
| 308 | - gpgv |
| 309 | - grep |
| 310 | - gzip |
FAILED: Continuous integration, rev:dc7d6336cbf a192a615187b5f2 fe345eaf3c40d5 /jenkins. canonical. com/server- team/job/ git-ubuntu- ci/85/
https:/
Executed test runs:
SUCCESS: VM Setup
SUCCESS: Clone
FAILED: Build
Click here to trigger a rebuild: /jenkins. canonical. com/server- team/job/ git-ubuntu- ci/85// rebuild
https:/