snapcraft:remote-build

Last commit made on 2019-09-17
Get this branch:
git clone -b remote-build https://git.launchpad.net/snapcraft

Branch merges

Branch information

Name:
remote-build
Repository:
lp:snapcraft

Recent commits

88b13cb... by Sergio Schvezov on 2019-09-17

remote build: switch from core to core18

snapcraft on edge is now on core18.

Signed-off-by: Sergio Schvezov <email address hidden>

3dcee9b... by Chris Patterson on 2019-08-27

remote-build: error if --user is required

When initializing LaunchpadClient, lookup user information from
snapcraft config. If not present, and user not passed in, raise
error to inform user --user is required. I effectively broke
this behavior in 4253354cf3f995da19f1a568ffcaaa3a1c3359d3 because
this was done in login(), but not consistent with push_source_tree().

- Rename self.user -> self._user for consistency.

- Modify login() and push_source_tree() to use saved username.

- Move launchpad init up before worktree preparation so it fails
  soonest if --user was required.

- Shuffle config handling bits into _load_snapcraft_config() and
  _update_snapcraft_config().

- Update unit tests.

Signed-off-by: Chris Patterson <email address hidden>

d3660a1... by Chris Patterson on 2019-07-30

remote-build: use project name in build-id for launchpad git repo

Incorporate the project name into the build-id so it's identifiable when
looking at the list of snaps from the launchpad web portal.

When building `figlet`, instead of having a git repo like:
- snapcraft-891d00183565470496c42f4bdaed4388
It would now be:
- snapcraft-figlet-891d00183565470496c42f4bdaed4388

Signed-off-by: Chris Patterson <email address hidden>

c4fa280... by Chris Patterson on 2019-07-26

remote-build/launchpad: pivot to git source handler

- Drop use of GitPython.
- Add test to test push_source_tree.

Signed-off-by: Chris Patterson <email address hidden>

41c87ad... by Chris Patterson on 2019-07-26

git: add init, add, commit, push, version, check_if_installed functions

Will be utilized for git functionality required for remote-build.

Signed-off-by: Chris Patterson <email address hidden>

46ff1ef... by Chris Patterson on 2019-07-25

remote-build: introduce --package-all-sources flag

By default, remote-build will package up local sources for
the remote builder. In cases where part sources may be in
private repositores (firewall, vpn, authentication, etc.),
the user may now specify --package-all-sources to pull and
package all project sources that the remote builder may not
be able to access.

Signed-off-by: Chris Patterson <email address hidden>

c958e6c... by Chris Patterson on 2019-07-26

remote-build: fully preserve local sources

Fetch all "local" project parts and archive them inside of a git repo
for launchpad to build with.

Packaged sources are compressed with gzip'd tar files to prevent any
potential git-tracking-unfriendly sources from being added to the
created git repository.

- rewrite snapcraft.yaml shipped to launchpad to reflect source handling

- drop Repo class

- drop --git option

- Update "Worktree" class to manage the project's working tree and the
  creation of source repository that may be used by remote builders.
  Support gitification of the packaged source repository for remote
  builders that utilize it, i.e. launchpad.

- Raise error if base is not used, or suppported by remote-build.

- Raise error if `version-script` is used, it's being deprecated in
  favour of snapcraftctl set-version scriptlet.

Signed-off-by: Chris Patterson <email address hidden>

356c081... by Chris Patterson on 2019-07-25

fixtures/SnapcraftYaml: rewrite snapcraft.yaml on updates

Signed-off-by: Chris Patterson <email address hidden>

578b950... by Chris Patterson on 2019-07-26

remote-build: detect early build errors (#2642)

The easiest-to-reproduce example I have come across is to simply
ship the build repository to launchpad without a snapcraft.yaml. In
this case, snapcraft now fails with the following message from launchpad:

```
  Sorry, an error occurred in Snapcraft:
  Remote builder failed with error: 'Cannot find snapcraft.yaml in
  https://<email address hidden>/~cjp256/+git/snapcraft-6cf35d52abc44b19a021b100cb883c8a/ master'
```

The original assumption was that the builder was busy, but now we can
determine if that's truly the case by checking if status is still "Pending".

- A new exception for RemoteBuilderError(err) added.
- Additional sanity checks added for cases that shouldn't occur.
- Added and updated launchpad tests.

Also, switch DictAttr to FakeLaunchpadObjects in tests.
The launchpad objects generally have lookup behavior of dictionaries,
but keys are also accessible via instance fields. DictAttr provided
the same behavior, FakeLaunchObject firms up the implementation a bit.

Use it for recently introduced fake implementations.

Signed-off-by: Chris Patterson <email address hidden>

7b675b4... by Claudio Matsuoka on 2019-06-22

remote build: add option to skip public upload question (#2590)

Refactor public upload confirmation to use click option prompt and add
common tty-aware classes to handle user input.

Signed-off-by: Claudio Matsuoka <email address hidden>