diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 256bc582db..0a11f13634 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -5,6 +5,8 @@ on: push: branches: - "feature/**" + # allow manual re-publishing as branches expire after 30 days + workflow_dispatch: jobs: publish: diff --git a/.github/workflows/security-scan.yaml b/.github/workflows/security-scan.yaml new file mode 100644 index 0000000000..20770c8ad9 --- /dev/null +++ b/.github/workflows/security-scan.yaml @@ -0,0 +1,17 @@ +name: Security scan +on: + pull_request: + push: + branches: + - main + - hotfix/* + - work/secscan # For development + +jobs: + python-scans: + name: Scan Python project + uses: canonical/starflow/.github/workflows/scan-python.yaml@main + with: + packages: python-apt-dev + osv-extra-args: '--config=source/osv-scanner.toml' + trivy-extra-args: '--severity HIGH,CRITICAL --ignore-unfixed --skip-dirs "tests/spread/**"' diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a5c3f506a4..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,78 +0,0 @@ -language: bash -dist: bionic - -env: - global: - - LC_ALL: "C.UTF-8" - - LANG: "C.UTF-8" - - PATH: "/snap/bin:$PATH" - -jobs: - include: - - stage: snap - name: snap - workspaces: - create: - name: snaps - paths: - - "snapcraft-pr$TRAVIS_PULL_REQUEST.snap" - addons: - snaps: - - name: snapcraft - channel: stable - classic: true - - name: transfer - - name: http - apt: - packages: - - libapt-pkg-dev - - libffi-dev - - libnacl-dev - - libsodium-dev - - libssl-dev - - libyaml-dev - - python3.6-dev - script: - - snapcraft snap --destructive-mode --output "snapcraft-pr$TRAVIS_PULL_REQUEST.snap" - - sudo snap install "snapcraft-pr$TRAVIS_PULL_REQUEST.snap" --dangerous --classic - - snapcraft clean --destructive-mode - - snapcraft snap --destructive-mode --output "snapcraft-pr$TRAVIS_PULL_REQUEST.snap" - after_success: - - timeout 180 /snap/bin/transfer snapcraft-pr$TRAVIS_PULL_REQUEST.snap - after_failure: - - sudo journalctl -u snapd - - /snap/bin/http https://api.snapcraft.io/v2/snaps/info/core architecture==amd64 Snap-Device-Series:16 - - - stage: integration - name: store - workspaces: - use: snaps - if: head_repo = "canonical/snapcraft" - script: - - ./runtests.sh spread "google:ubuntu-18.04-64:tests/spread/general/store" - - - stage: docker - env: - RISK: "stable" - script: - - cd docker - - docker build --no-cache -f ${RISK}.Dockerfile --tag canonical/snapcraft:${RISK} . - - docker run canonical/snapcraft:${RISK} snapcraft --version - - env: - RISK: "edge" - script: - - cd docker - - docker build --no-cache -f ${RISK}.Dockerfile --tag canonical/snapcraft:${RISK} . - - docker run canonical/snapcraft:${RISK} snapcraft --version - - env: - RISK: "beta" - script: - - cd docker - - docker build --no-cache -f ${RISK}.Dockerfile --tag canonical/snapcraft:${RISK} . - - docker run canonical/snapcraft:${RISK} snapcraft --version - - env: - RISK: "candidate" - script: - - cd docker - - docker build --no-cache -f ${RISK}.Dockerfile --tag canonical/snapcraft:${RISK} . - - docker run canonical/snapcraft:${RISK} snapcraft --version diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 35d4d115f1..0000000000 --- a/Dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -FROM ubuntu:xenial - -RUN apt-get update && \ - apt-get dist-upgrade --yes && \ - apt-get install --yes \ - git \ - snapcraft \ - && \ - apt-get autoclean --yes && \ - apt-get clean --yes - -# Required by click. -ENV LC_ALL C.UTF-8 -ENV SNAPCRAFT_SETUP_CORE 1 diff --git a/HACKING.md b/HACKING.md index 68d976d7a5..ab505761f3 100644 --- a/HACKING.md +++ b/HACKING.md @@ -98,8 +98,9 @@ tox run -e lint-codespell ## Evaluating pull requests -Oftentimes all you want to do is see if a given pull request solves the issue you were having. To make this easier, the Travis CI setup for snapcraft _publishes_ the resulting snap that was built for x86-64 using `transfer.sh`. -To download the snap, find the relevant CI job run for the PR under review and locate the "snap" stage, the URL to download from will be located at the end of logs for that job. +Oftentimes all you want to do is see if a given pull request solves the issue you were having. To make this easier, a snap is published for `amd64` on a channel named `latest/edge/pr-` where `PR number` is the number of the pull request. + +For feature branches, a snap is published for `amd64` on a channel named `latest/edge/`. For example, a branch named `feature/offline-mode` would be available on the channel `latest/edge/offline-mode`. ## Reaching out diff --git a/MANIFEST.in b/MANIFEST.in index ab2b4cf212..f24832561c 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,2 @@ include schema/* include extensions/* -include debian/changelog diff --git a/README.md b/README.md index a8b6e875f8..e8b6707df8 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ [![snapcraft](https://snapcraft.io/snapcraft/badge.svg)](https://snapcraft.io/snapcraft) -[![Build Status][travis-image]][travis-url] [![Documentation Status](https://readthedocs.com/projects/canonical-snapcraft/badge/?version=latest)](https://canonical-snapcraft.readthedocs-hosted.com/en/latest/?badge=latest) [![Scheduled spread tests](https://github.com/canonical/snapcraft/actions/workflows/spread-scheduled.yaml/badge.svg?branch=main)](https://github.com/canonical/snapcraft/actions/workflows/spread-scheduled.yaml) [![Coverage Status][codecov-image]][codecov-url] @@ -29,8 +28,5 @@ Learn about the latest features by following Snapcraft on We love contributors. Read the [hacking guide](HACKING.md) if you're interested in helping out. -[travis-image]: https://travis-ci.org/canonical/snapcraft.svg?branch=master -[travis-url]: https://travis-ci.org/canonical/snapcraft - [codecov-image]: https://codecov.io/github/canonical/snapcraft/coverage.svg?branch=master [codecov-url]: https://codecov.io/github/canonical/snapcraft?branch=master diff --git a/TESTING.md b/TESTING.md index 71a0be2e93..2d4671d6ce 100644 --- a/TESTING.md +++ b/TESTING.md @@ -40,14 +40,6 @@ These tests are in the `tests/integration` directory, with the `snapcraft.yamls` At any time, an integration test may fail and given the use of temporary directories it can be hard to inspect what went on. When working on a specific test case you can set the environment variable `SNAPCRAFT_TEST_KEEP_DATA_PATH` to a directory path for the sepecic test. This mechanism will only work when working with individual tests and will fail to run with a batch of them. -### Slow tests - -Some tests take too long. This affects the pull requests because we have to wait for a long time, and they will make Travis CI timeout because we have only 50 minutes per suite in there. The solution is to tag these tests as slow, and don't run them in all pull requests. These tests will only be run in autopkgtests. - -To mark a test case as slow, set the class attribute `slow_test = True`. - -To run all the tests, including the slow ones, set the environment variable `SNAPCRAFT_SLOW_TESTS=1`. - ### Snaps tests The snaps tests is a suite of high-level tests that try to simulate real-world scenarios of a user interacting with snapcraft. They cover the call to snapcraft to generate a snap file from the source files of a fully functional project, the installation of the resulting snap, and the execution of the binaries and services of this snap. @@ -120,35 +112,6 @@ We can currently run a minimal subset of snapcraft integration tests on macOS. T For manual exploratory testing, the team has one mac machine available. -## Autopkgtests for the snapcraft deb - -Autopkgtests are tests for the project packaged as a deb. The unit tests are run during autopkgtests while the snapcraft deb is being built. Then the resulting deb is installed, and the integration and snaps suites are executed using the installed snapcraft. - - -### How to run on Xenial - -The easiest way is to use a LXC container. From the root of the project, run: - - sudo apt install autopkgtest - adt-run --unbuilt-tree . --apt-upgrade --- lxd ubuntu:xenial - -It's possible to select only one of the suites using `--testname`, for example: - - adt-run --unbuilt-tree . --apt-upgrade --testname=integrationtests --- lxd ubuntu:xenial - - -### How to run on Bionic - -The easiest way is to use a LXC container. From the root of the project, run: - - sudo apt install autopkgtest - autopkgtest . -U -- lxd ubuntu:xenial - -It's possible to select only one of the suites using `--test-name`, for example: - - autopkgtest . -U --test-name=integrationtests-spread -- lxd ubuntu:xenial - - ## Spread tests for the snapcraft snap [Spread](https://github.com/canonical/spread) is a system to distribute tests and execute them in different backends, in parallel. We are currently using spread only to run the integration suite using the installed snapcraft snap from the edge channel. diff --git a/debian/changelog b/debian/changelog deleted file mode 100644 index 3636153038..0000000000 --- a/debian/changelog +++ /dev/null @@ -1,3681 +0,0 @@ -snapcraft (3.9.1) bionic; urgency=medium - - [ Sergio Schvezov ] - * ci: switch to travis workspaces - * states: add support for required-grade in global state - * lifecycle: store the required grade depending on the base - * meta: move grade setting logic back to snap_packaging - - [ Chris Patterson ] - * yaml_utils: move project_info's _load_yaml to yaml_utils - * yaml_utils: introduce a couple of unit tests for load_yaml_file - * remote-build: rename `--arch` to `--build-on` - * remote-build: prepend 'launchpad' to 'user' and 'accept-public-upload' - - -- Sergio Schvezov Fri, 01 Nov 2019 17:57:43 +0000 - -snapcraft (3.9) bionic; urgency=medium - - [ Sergio Schvezov ] - * tests: print journal logs when spread tests fail - * meta: new application handler - * meta: add desktop file handling to application - * meta: move desktop file cleanup to a separate method - * meta: replace logic in _SnapPackaging with Application - * tests: completely mock bzr tests - * tests: completely mock mercurial tests - * tests: completely mock 7z tests - * snap: migrate to core18 - * ci: move unit tests to spread - * build providers: inject core18 instead of core - * tests: completely mock subversion tests - * docs: add a Code of Conduct (#2724) - * pluginhandler: remove the exception for elf patching go - * project: support for base bare - * tests: update rust-toolchain test so it pulls from beta - * storeapi: use the channels attribute in push - * meta: take no command-chain being prepended into account - * cli: add -s back to clean for legacy (LP: #1834628) - * cli: prompt for login if required - * extensions: new kde-neon extension - * cli: use click utilities for login prompts - * meta: warn about command mangling - * storeapi: add StoreErrorList to handle store errors - * cli: clean up StoreClientCLI - * tests: move cli store push/upload tests to FakeStoreCommands... - * cli: use click utilities for registering on push (LP: #1805211) - * meta: support the case of a plug without a default provider - * remote build: switch from core to core18 - * make plugin: support for core20 - * snaps: invalidate cache on refresh or install - * snaps: allow installation of non stable bases - * meta: force grade devel when using non stable bases - * build providers: inject snapd snap for latest feature availability - * repo: convey proper error message when refreshing to invalid channel - * cli: pass channels None when not doing a push --release - - [ Chris Patterson ] - * tests: change default spread provider to lxd outside of travis - * meta: handle desktop files with multiple sections - * meta: preserve desktop file Exec= arguments - * snaps: if snap is installed, don't check is_valid() - * mypy.ini: set python version to 3.6 - * tests: minor fixups for mypy to run successfully - * runtests: add mypy coverage of unit tests to static target - * errors: add new abstract base class for snapcraft exceptions - * cli: add support for new-style snapcraft exceptions - * tests: fix mypy error with test_errors.py - * meta: introduce snap, hook, plug, and slot types - * application: refactor to work with introduced snap meta objects - * command: refactor to work with Snap meta - * project: instantiate snap meta - * project: introduce _get_content_snaps() and _get_provider_content_dirs() - * project-loader: initialize project._snap_meta when data is updated - * runner: install content snaps when installing build snaps - * meta: remove create_snap_packaging from init to prevent import loop - * snap-packaging: refactor to use Snap - * pluginhandler: refactoring dependency resolution - * elf: consider content directories for determining dependencies - * common: rename get_core_path() to get_installed_snap_path() - * pluginhandler: add some type annotations - * fixtures: mock patch Project._get_provider_content_dirs() - * spread tests: update unicode-metadata expect_snap.yaml's ordering - * snap-packaging: do not write command-chain wrapper if there are no apps - * project options: add compatibility shims for tests - * elf: handle missing dependencies not found on system - * tests: update gnome-3-28 extension spread test to use gtk - * tests: update gnome extension spread task to account for content snaps - * tests: update kde extension spread task to account for content snaps - * remote-build: detect early build errors (#2642) - * fixtures/SnapcraftYaml: rewrite snapcraft.yaml on updates - * remote-build: fully preserve local sources - * remote-build: introduce --package-all-sources flag - * git: add init, add, commit, push, version, check_if_installed functions - * remote-build/launchpad: pivot to git source handler - * remote-build: use project name in build-id for launchpad git repo - * remote-build: error if --user is required - * requirements: add lazr.restfulclient dependency for launchpad - * windows: update snapcraft.spec for new remote-build dependencies - * remote-build: make --user required and drop config file handling - * remote-build: only prepare project if starting build - * project: add `_get_project_directory_hash` method - * remote-build: use project directory hash for id - * remote-build: introduce LaunchpadGitPushError - * tests/remote-build: minor cleanup for mock usage - * remote-build: update launchpad to support git https tokens - * tests/remote-build: cleanup usage of mock_lp - * remote-build: graduate from preview -> experimental - * errors: migrate handful of errors to SnapcraftException - * project: truncate project directory hash (#2766) - * setup.py: convert classifiers from tuple to list - * sources: add some initial support for win32 - * file_utils: fix create_similar_directory on Windows platforms - * file_utils: add cross-platform rmtree (Windows support) - * remote-build: use file_utils.rmtree for Windows support - * remote-build: use posix pathing when creating paths for snapcraft yaml - * remote-build: gunzip downloaded log files - * manifest: sort package and snap lists for consistency - * remote-build: cleanup and fix architecture handling - * remote-build: explicitly default build arch to host arch - * remote-build: remove `all` option for `--arch` - * remote-build: remove old TODO comment - * erorrs: preserve quotes when printing SnapcraftPluginCommandError - * remote-build: improve resiliency for https connection issues - * remote-build: add unit tests for errors - * remote-build: support autorecovery of builds - - [ Claudio Matsuoka ] - * cli: add remote build (#2500) - * remote build: add warning before sending data (#2567) - * remote build: retrieve build log files (#2574) - * remote build: don't send log files back to remote - * remote build: handle git push in detached head state (#2564) - * remote build: add option to skip public upload question (#2590) - - [ Kyle Fazzari ] - * cmake plugin: support disable-parallel option - * project: use os.sched_getaffinity instead of multiprocessing.cpu_count - * project_loader: load build-environment after snapcraft environment - - [ Merlijn Sebrechts ] - * extensions: add gsettings plug to gnome-3-28 extension - * docs: Added 'shellcheck' testing dependency - * extensions: support using gjs from gnome runtime - * appstream: extract title and version - * docs: use real testing examples - * appstream: support legacy ids without desktop suffix (LP: #1778546) - * extensions: kde-neon: add icon and sound themes - - [ NickZ ] - * nodejs plugin: fix errors when building with sudo (#2747) - - [ Anatoli Babenia ] - * docker: use apt-get to avoid warnings (#2672) - - [ Ken VanDine ] - * gnome extension: use the snap name only for the default-provider (#2763) - * kde neon extension: use the snap name only for the default-provider (#2764) - - -- Sergio Schvezov Tue, 29 Oct 2019 01:13:57 +0000 - -snapcraft (3.8) xenial; urgency=medium - - [ Sergio Schvezov ] - * test: autopkgtest beta - * debian: minimal deb package for autopkgtest - * extensions: new gnome extension (#2655) - * deltas: code cleanup - * tests: move meta testing to its own package - * yaml utils: move OctInt from meta - * spread tests: minor performance improvements - * meta: move _errors to errors with related error classes - * meta: decouple DesktopFile logic - * schema: schema: build-base support for the snapd type - * rust plugin: support for s390x - * schema: build-base support for the kernel type - * spread tests: update gnome extension tests - * extensions: rename extension classes to known names - * extensions: create the gnome-platform directory - * extensions: improve docsting (used in the cli) - * spread tests: finer grained arch support for autopkgtests - - [ Chris Patterson ] - * elf: handle invalid elf files - * cli: handle exception when cleaning a part with a fresh project - * spread: fix unbound variable error - * docs: quick init for lxd in HACKING.md - * windows: drop cx_Freeze support in setup.py - * cli: use absolute import paths instead of relative imports - * requirements: update to python 3.7 for PyYaml wheel - * requirements: uprev all OS to pexpect 4.7.0 - * requirements: add pyinstaller 3.5 for win32 - * windows: add snapcraft.ico icon - * windows: add pyinstaller spec file to generate frozen snapcraft.exe - * dirs: find Windows data directory for currently-known scenarios - * lxd: conditionally import pylxd based on OS - * windows: add inno-installer script - * windows: add powershell script to generate self-signed certificate - * tests: fix snapcraft command for win32 virtual env - * appveyor: build Windows inno-installer - * windows: add MSIX/AppX installer - * dirs: raise SnapcraftDataDirectoryMissingError() if paths not set - * multipass: update ProverNotFound url to https://multipass.run - * indicators: windows fix for is_dumb_terminal - * multipass: add installation support for windows - * travis: use apt addon to prevent apt update issues in CLA-check - * multipass: fix setup exception when multipass is not found in PATH - * dirs: check for existence of required data directories - - [ Jeremie Deray ] - * catkin plugin: forward parallel build count (#2669) - * colcon plugin: forward parallel build count (#2670) - - [ Anatoli Babenia ] - * lifecycle: add support for building inside podman containers (#2659) - * docker: remove snapcraft-wrapper - - [ Stefano Rivera ] - * repo: properly handle install query for unknown apt packages (#2692) - - [ Kyle Fazzari ] - * spread tests: install package marker into ament index - * colcon plugin: add ability to ignore packages (#2687) - - -- Sergio Schvezov Thu, 05 Sep 2019 15:48:57 +0000 - -snapcraft (3.7.2) xenial; urgency=medium - - [ Sergio Schvezov ] - * meta: transparently support command-chain - * extensions: structure the base extension class - * extensions: refactor checks into the extension base class - * extensions: support confinement restrictions - * appstream: xslt support for ul nested in p - - [ Colin Watson ] - * store: send snapcraft-started-at in push requests - - [ Chris Patterson ] - * scriplets: run override-pull on update_pull (#2653) - * cli: replace HiddenOption with click 7.0's new flag (#2654) - - -- Sergio Schvezov Wed, 07 Aug 2019 23:54:28 +0000 - -snapcraft (3.7.1) xenial; urgency=medium - - [ Sergio Schvezov ] - * ant plugin: correct default channel and improve help - * cli: improve help for push-metadata - * project, cli: clean up snap asset messages - * file utils: better error for NotADirectory - * cli: only say sorry for in-snapcraft issues - - [ Chris Patterson ] - * deprecations: add deprecation notice for version-script (dn10) - - [ Carlo Lobrano ] - * meta: add InvalidAppCommand errors for non-existent and not-found (#2539) - - -- Sergio Schvezov Tue, 30 Jul 2019 17:59:00 +0000 - -snapcraft (3.7) xenial; urgency=medium - - [ Sergio Schvezov ] - * static: use beta channel for black (#2606) - * catkin spread tests: dump apt-config on failures for legacy (#2610) - * rust plugin: use toml to dump the config (#2611) - * rust plugin: use rust-toolchain by default if present (#2613) - * conda plugin: new plugin (#2608) - * build providers: support injection for LXD (#2621) - * schema: remove support for os when using bases (#2626) - * appstream extractor: skip non icon file paths (#2630) - * spread tests: enable LXD build provider tests (#2631) - * build environment: detect base type and use name as base - * plugins: use get_build_base to determine base support - * project: add support for build-base - * repo: add support for querying file ownership - * pluginhandler: suggest stage-packages for missing DT_NEEDED - * tests: add python3-toml for autopkgtests - * spread tests: limit conda plugin to non autopkgtests x86-64 systems - * spread tests: crystal tests should only run on x86-64 - - [ Chris Patterson ] - * black: minor format changes from updated black (#2603) - * sources: introduce SnapcraftSourceNotFoundError (#2604) - * spread: use more workers to reduce job times - * catkin/legacy-pull: set test to manual - * cli: convert users of click.confirm/prompt to echo.confirm/prompt - * echo: respect SNAPCRAFT_HAS_TTY for is_tty_connected() - * ant plugin: switch to using ant snap for building (by default) - * general spread tests: set base for cwd test (#2618) - * errors: refactor exception/error handling (#2602) - * tests/unit/pluginhandler: introduce tests to repro symlink preservation bug - * file_utils/create_similar_directory: drop follow_symlinks option - * pluginhandler: honour symlink directory paths for filesets (LP: #1833408) - * test_pluginhandler: remove faulty (redundant) tests - * schema: synchronizing snapd supported schema to snapcraft (#2627) - - [ Brian J. Cardiff ] - * crystal plugin: new plugin (#2598) - - [ Mike Miller ] - * build providers: enforce well-known temp dir (#2607) (LP: #1833292) - - [ Pawel Stolowski ] - * schema: allow snapd as snap type (#2609) - - [ Claudio Matsuoka ] - * echo: add wrappers for click.prompt() and click.confirm() - - [ Kyle Fazzari ] - * colcon plugin: add support for dashing (#2593) - - [ anatoly techtonik ] - * cli: add -h short option for help (#2527) (LP: #1807423) - - [ Stefan Bodewig ] - * use the stable risk level now that ant has been released - - [ Chris MacNaughton ] - * rust plugin: add ability to rebuild (#2620) (LP: #1825858) - - [ Carlo Lobrano ] - * tools: let environment-setup.sh skip unnecessary steps (#2625) - - -- Sergio Schvezov Mon, 22 Jul 2019 19:10:34 +0000 - -snapcraft (3.6) xenial; urgency=medium - - [ Sergio Schvezov ] - * docker images: update to be self contained (#2591) - * static: update to newer black (#2599) - * repo: set priority to critical for debs (LP: #1821313) - - [ Kyle Fazzari ] - * docker images: use build stages and generate locale (#2588) - * {catkin,colcon} plugin: remove old ROS key (#2586) - * catkin plugin: check workspace for dependencies (#2585) (LP: #1832044) - - [ Stefan Bodewig ] - * ant plugin: make build file location configurable (#2596) - - [ Chris Patterson ] - * tools: add `black` snap to environment-setup.sh (#2595) - - [ dependabot[bot] ] - * requirements: bump pyxdg from 0.25 to 0.26 (#2587) - - -- Sergio Schvezov Fri, 14 Jun 2019 20:00:41 +0000 - -snapcraft (3.5.1) xenial; urgency=medium - - [ Sergio Schvezov ] - * requirements: update to requests-toolbelt 0.8.0 (#2565) - * kernel plugin: correctly download the os.snap (#2566) (LP: #1828843) - * docs: consolidate on a simple HACKING.md (#2568) - * plainbox spread tests: lock down python packages (#2579) - * cli: refactor re-execution into legacy (#2571) - * plainbox spread tests: use https for the git source entries (#2583) - * catkin spread tests: finer system filter for legacy-pull (#2584) - * unit tests: stricter file checking on store download tests - * LEGACY common: add is_deb method - * LEGACY lifecycle: warn about bases - * LEGACY unit tests: stricter testing for common.is_deb - * LEGACY common: take into account dpkg not being found - * LEGACY common: check if running from snap before deb - * LEGACY common: check for relative argv0 in is_deb - - [ Ian Metcalf ] - * dotnet plugin: fix parsing of newer sdk releases (#2537) - - [ Kyle Fazzari ] - * catkin spread tests: use kinetic instead of indigo (#2575) (LP: #1830769) - * keyrings: update ROS signing key (#2578) - * LEGACY tests: stop testing indigo in catkin spread (#2572) - * LEGACY catkin plugin: remove default rosdistro (#2576) - - [ Adam Collard ] - * cli: add --destructive-mode to clean (#2577) - - [ Michael Vogt ] - * cli: do not prompt when there is no tty available on stdin (#2570) - - [ dalance ] - * rust plugin: fix linker on i386 (#2580) - - -- Sergio Schvezov Thu, 06 Jun 2019 19:24:29 +0000 - -snapcraft (3.5) xenial; urgency=medium - - [ Sergio Schvezov ] - * vcs: ignore .idea (#2558) - * ci: remove dependency on LXD from travis tests (#2557) - * cli: snapcraft promote (#2556) (LP: #1827513) - * manifest: expose snapcraft-started-at (#2559) (LP: #1806658) - * storeapi: allow promotion from branches - * tests: release and promote to grade devel channels - * tests: fix the status test - * tests: add ppc64el to the fake server info results - - [ Claudio Matsuoka ] - * project: read local plugins from build-aux (#2551) (LP: #1827095) - * extensions: block direct use of private extensions (#2555) - - [ Daniel Llewellyn ] - * meta: take ${SNAP} into account .desktop icon checks (#2541) - - -- Sergio Schvezov Sat, 11 May 2019 14:56:00 +0000 - -snapcraft (3.4.1) xenial; urgency=medium - - [ Sergio Schvezov ] - * tests: add a set_confinement helper - * tests: classic confinement spread tests for ant and maven (LP: #1805206) - * build providers: get rid of attribute warnings from pylxd (#2535) - * rust plugin: fix usage of rust-channel (#2538) (LP: #1825062) - * storeapi: move from details (v1) to info (v2) (#2550) - - [ Tony Simpson ] - * project loader: add SNAPCRAFT_PROJECT_DIR environment variable (#2534) - (LP: #1824417) - - [ Kyle Fazzari ] - * tests: allow python2 as well as python for catkin spread tests (#2540) - * integration tests: use correct series in get_package_version (#2548) - * catkin plugin: use build-packages for compilers (#2545) (LP: #1827148) - - [ Claudio Matsuoka ] - * extractors: fix typo in appstream icon unit test (#2543) - * meta: Validate common ID against appstream metadata (#2542) (LP: #1814902) - - -- Sergio Schvezov Fri, 03 May 2019 12:48:58 +0000 - -snapcraft (3.4) xenial; urgency=medium - - [ Sergio Schvezov ] - * build providers: modify the _run signature (#2511) (LP: #1821401) - * build providers: support for provider setup (#2515) (LP: #1821586) - * readme: add snap store badge (#2516) - * build providers: initial support for LXD (#2509) (LP: #1805221) - * cli: cleanup environment detection (#2521) - * build providers: add API for friendly instance type names (#2522) - * snap: set core as a base (#2520) - * ci: improve travis integration conditionals (#2523) - * cli: snapcraft try (#2524) (LP: #1805212) - * build providers: idempotent destroy for LXD (#2529) - * tests: add missing pylxd Build-Depends - * tests: restrict catking stage-snap tests arches - - [ Claudio Matsuoka ] - * repo: handle deb package fetch error (#2513) - * project: ensure yaml load returns a dictionary (#2517) - * many: better handling of appstream icons (#2512) (LP: #1814898) - * go plugin, elf: use patchelf 0.10 and relink dynamic go binaries (#2519) - (LP: #1805205) - * snap: use snapcraft's 0.10 patchelf branch (#2528) - * snap: revert to patchelf 0.9 with local patches (#2531) - - [ adanhawth ] - * schema: add more detail wrt numeric version errors (#2506) - - [ Kyle Fazzari ] - * catkin plugin: check stage-snaps for ROS dependencies (#2525) - - -- Sergio Schvezov Mon, 08 Apr 2019 20:40:27 +0000 - -snapcraft (3.3) xenial; urgency=medium - - [ Sergio Schvezov ] - * many: support for "base: core" in snapcraft.yaml (#2499) (LP: #1819290) - * python plugin: graceful ret when no packages set (#2498) (LP: #1794216) - * many: support the use of build-aux/snap (#2496) (LP: #1805219) - * nodejs pluging: support for type str bin entries (#2501) (LP: #1817553) - * store: support registering to a specific store (#2479) (LP: #1820107) - * meta: fix management of snap/local (#2502) - * tests: improve login pexpect errors - * tests: correctly retry registers - * build providers: enhance provider errors (#2508) (LP: #1821217) - * build providers: improve handling in snap logic (#2507) (LP: #1820864) - * tests: filter per arch and fix snap build deps - - [ Claudio Matsuoka ] - * sources: handle network request errors (#2494) - * store: handle invalid snap file errors (#2492) - * tests: fix multipass error handling spread test (#2491) - * plugins: improve python and go schema validation (#2473) (LP: #1806055) - * cli: disable raven if not running from package (#2503) - - [ Facundo Batista ] - * schema: better 'version' error messages: wrong type and incorrect length (#2497) - (LP: #1815812) - - -- Sergio Schvezov Thu, 21 Mar 2019 20:34:19 +0000 - -snapcraft (3.2) xenial; urgency=medium - - [ Sergio Schvezov ] - * many: support for stage-snaps (#2468) (LP: #1805214) - * project loader: do not leak a part's build-environment (#2472) - (LP: #1815658) - * build providers: remove dead code (#2474) - * tests: disable spread colcon tests (#2476) - * ci: shallow clones for CLA checks on travis (#2477) - * meta: handle symlinked hooks (#2478) - * Update setup.py - * Update PULL_REQUEST_TEMPLATE.md - * project loader: remove special LD_LIBRARY_FLAGS handling for classic (#2485) - (LP: #1817300) - * sources: avoid marking changes to the snap directory as dirty (#2475) - (LP: #1806746, #1816397) - - [ Claudio Matsuoka ] - * cli: clean up snapcraft push output (#2469) (LP: #1804439) - * cli: handle legitimate provider exec errors (#2483) - - [ Daniel Llewellyn ] - * schema: convert yaml jsonschema document to a json equivalent (#2448) - - [ Kyle Fazzari ] - * tests: make before/after items an array in schema test (#2465) - * ruby plugin: support new download URL (#2466) (LP: #1815336) - * colcon plugin: new plugin (#2456) (LP: #1805213) - * colcon plugin: support build-time chaining (#2486) (LP: #1816565) - - -- Sergio Schvezov Tue, 26 Feb 2019 18:25:49 +0000 - -snapcraft (3.1.1) xenial; urgency=medium - - [ Sergio Schvezov ] - * ant, maven and gradle plugins: use correct defaults for jre (#2453) - (LP: #1813637, #1813636) - * rust plugin: new link for rustup (#2438) (LP: #1662960) - * baseplugin: add a proper exception for cross-compilation support (#2454) - (LP: #1808454) - * clean: error out on invalid or missing yaml (#2458) (LP: #1777501) - * lifecyle: avoid installation of snaps in docker (#2457) (LP: #1814148) - * ci: use non virt-enabled gce instances for 16.04 (#2461) - - [ Buo-ren Lin ] - * extractors: fix typo in code comment (#2452) - - [ Claudio Matsuoka ] - * pluginhandler: handle removal of inconsistent files (#2450) (LP: #1813033) - * cli: retrieve error data from provider (#2455) (LP: #1793082) - * build providers: recreate instance if base changed (#2460) (LP: #1794506) - - [ Kyle Fazzari ] - * catkin plugin: describe how to build all packages (#2459) - - -- Sergio Schvezov Wed, 06 Feb 2019 15:49:45 +0000 - -snapcraft (3.1) xenial; urgency=medium - - [ Sergio Schvezov ] - * cmake plugin: use native primitives (#2397) (LP: #1802314) - * cmake plugin: use build snaps to search paths (#2399) (LP: #1802314) - * static: update to the latest flake8 (#2420) (LP: #1807409) - * project: state file path change (#2419) (LP: #1806746) - * nodejs plugin: fail gracefully when a package.json is missing (#2424) - (LP: #1807971) - * tests: use fixed version for idna in plainbox (#2426) - * tests: remove obsolete snap and external tests (#2421) - * snap: re-add pyc files for snapcraft (#2425) (LP: #1808199) - * tests: increase test timeout for plainbox (#2428) - * lifecycle: query for multipass install on darwin (#2427) (LP: #1807737) - * extractors: better appstream support for descriptions (#2430) (LP: #1778545) - * tests: re-enable spread tests on gce - * rust plugin: refactor to use the latest rustup (LP: #1809259) - * tests: temporarily disable osx tests - * snap: add build-package for xml - * appstream extractor: properly find desktop files (LP: #1805431) - * appstream extractor: support legacy launchables (LP: #1778546) - * snap: add xslt dependencies for lxml - * schema: allow before and after (#2443) (LP: #1808148) - * build providers: remove SIGUSR1 signal ignore workaround for multipass (#2447) - * cli: enable cleaning of parts (#2442) (LP: #1779136) - * tests: appstream unit tests are xenial specific - * tests: skip rust unit tests on s390x - * tests: use more fine grained assertions in lifecycle tests - * tests: remove rust revision testing for i386 - - [ Johan Dahlin ] - * tests: do not use `bash` as a reserved package name on staging (#2423) - - [ Ricardo N Feliciano ] - * cli: fix usage string in help command (#2429) (LP: #1745040) - - [ Anatoli Babenia ] - * repo: document package purpose (#2390) - - [ Kyle Fazzari ] - * repo,baseplugin: support trusting repo keys (#2437) (LP: #1811304) - - [ MichaƂ Sawicz ] - * meta: make hooks executable instead of complaining they are not (#2440) - (LP: #1812003) - - -- Sergio Schvezov Thu, 24 Jan 2019 10:27:23 +0000 - -snapcraft (3.0.1) xenial; urgency=medium - - [ Sergio Schvezov ] - * ci: use more travis primitives for osx tests (#2383) - * project_loader: do not install base if already installed (#2384) - * cli: consolidate re-execution (#2385) - * project: early snapcraft.yaml validation (#2388) - * build providers: fix osx non base and injection (#2394) - * Partial Revert "build providers: fix osx non base and injection" (#2396) - * tests: fix maven spread test (#2400) - * ci: reduce spread system declarations (#2401) - * project_loader: add git to build-packages for version: git (#2403) - * ci: update travis.yaml to use xenial and addons (#2392) - * packaging: update requests (#2402) - * cli: handle yaml errors for cleanbuild (#2404) - * multipass: avoid stdin where possible (#2408) - * build providers: preset the timezone (#2407) - * python plugin: process deps before and separately from setup.py (#2409) - * yaml_utils: allow unicode while encoding (#2414) - * cli: snapcraft init with a base (#2411) - * schema: add support for title (#2412) - * tests: use autopkgtest to leverage snap testing (#2380) - - [ Kyle Fazzari ] - * tests: missing full adapter in extension test (#2382) - * meta: add assumes if using "full" app adapter (#2379) - * project_loader: raise error if part in after is undefined (#2386) - * spread: change virt-enabled image name (#2387) - - [ Erik Berkun-Drevnig ] - * cli: hide progress bar for dumb terminals (#2369) - - [ John R. Lenton ] - * tools: broader shellcheck including spread (#2381) - * tools: pull in imporved cla_check.py from snapd (#2415) - - [ Anatoli Babenia ] - * tests: run black with --diff (#2391) - - [ Evan Dandrea ] - * build providers: checks for when multipass is missing (#2354) - - -- Sergio Schvezov Thu, 29 Nov 2018 16:22:52 +0000 - -snapcraft (3.0) xenial; urgency=medium - - [ Sergio Schvezov ] - * docker: support for testing snapcraft in proposed (#2245) - * snap: add the https transport (#2244) - * build providers: environment setup for projects (#2225) - * build providers: provide support to shell in (#2249) - * build providers: shell in provider if debug is used (#2252) - * build-providers: add support for --shell-after (#2253) - * build providers: add support for --shell (#2254) - * build providers: snapcraft images for multipass (#2258) - * build providers: allow setting ram and disk size (#2260) - * build providers: inject the base for classic (#2261) - * build providers: allow snapcraft channel selection (#2265) - * build providers: refresh packages on bring up (#2267) - * build providers: let the implementor pick the image (#2269) - * reporting: fail gracefully on submit errors (#2271) - * meta: friendlier message for incorrect app command (#2272) - * snap: use a newer PyYAML and drop patches (#2274) - * build providers: use the best CPU configuration (#2273) - * build providers: use the provider if exported (#2275) - * snap: move to a newer pysha3 (#2277) - * spread: move legacy wiki tests to spread (#2276) - * snap: pull early (#2278) - * build providers: re-exec as root (#2281) - * build providers: cleaner start and launch messaging (#2282) - * build providers: make use of time for multipass stop (#2284) - * meta: support relocatable prime for path verification (#2287) - * build providers: use multipass automatically when on darwin (#2288) - * snap: workaround the dirty tree (#2294) - * tests: use SNAPCRAFT_PACKAGE_TYPE everywhere (#2295) - * tests: move most tests to spread and reorder travis.yaml (#2301) - * snap: improve early base detection logic (#2309) - * meta: link the icon correctly across filesystems (#2313) - * project loader: remove remote parts support for bases (#2304) - * tests: use mocked plugins for list-plugins (#2315) - * tests: add spread suite for plainbox plugin (#2317) - * plugins: remove the tar-content plugin when using a base (#2319) - * plugins: remove the copy plugin when using a base (#2308) - * meta: add support for the license field (#2318) - * build providers: use the new snapcraft: remote for multipass (#2293) - * plugins: remove the python2 and python3 plugin when using a base (#2325) - * plugins: remove the ament plugin when using a base (#2324) - * plugins: remove implicit source (#2326) - * go plugin: support for bases (#2323) - * pluginhandler: remove legacy plugin loading without project (#2329) - * godeps plugin: support for bases (#2328) - * pluginhandler: remove big solidus workaround (#2330) - * pluginhandler: remove prepare, build and install scriptlets (#2327) - * waf plugin: support for bases (#2332) - * meson plugin: add support for bases (#2331) - * lifecycle: remove lxd support for bases (#2335) - * tests: remove dependency on snapcraft for integration tests (#2353) - * schema: enfore string for versions (#2334) - * lifecycle: switch to multipass by default (#2339) - * build providers: remove the qemu implementation (#2345) - * schema: remove the deprecated snap keyword for bases (#2344) - * tests: use valid snap names in unit tests (#2352) - * scons plugin: add support for bases (#2357) - * nodejs plugin: add support for bases (#2356) - * pluginhandler: library detection instead of injection (#2337) - * dotnet plugin: add support for bases (#2358) - * schema: remove deprecated plugin pull and build-properties (#2361) - * plainbox-provider plugin: add support for bases (#2360) - * multipass: change default CPU value (#2365) - * python plugin: add support for bases (#2362) - * maven plugin: add support for bases (#2364) - * gradle plugin: add support for bases (#2372) - * ant plugin: add support for bases (#2370) - * jdk plugin: remove jdk (#2376) - * build providers: destroy on create failures (#2374) - * cli: remove disable-parallel-build and geoip toggles (#2377) - - [ Kyle Fazzari ] - * yaml loading: properly handle unhashable types (#2247) - * pluginhandler: stop using alias for snapcraftctl (#2251) - * local source: don't include .snapcraft directory (#2256) - * meta: take charge of environment used to run commands (#2257) - * cli: show trace if no tty (#2259) - * catkin plugin: use SnapcraftException (#2255) - * project_loader: add preflight check (#2250) - * project: catch parent YAML exceptions (#2263) - * tests: disable integration tests using snaps in bionic container (#2266) - * catkin, rosdep: stop using FileNotFoundErrors (#2270) - * sanity checks: allow snap/local dir (#2268) - * sanity checks: run properly on build VMs (#2279) - * snapcraft snap: refactor override-build into a script (#2283) - * config: change default outdated action to clean (#2286) - * snapcraft snap: vendor legacy snapcraft (#2285) - * schema: add "legacy" adapter type (#2262) - * sources: properly handle pull failures (#2292) - * packaging: pin click to v6 in requirements.txt (#2298) - * meta: put environment into runner instead of app wrapper (#2291) - * part grammar processor: lazily capture attributes from plugin (#2296) - * pluginhandler: update build should overwrite organize (#2290) - * requirements.txt: stop using pymacaroons-pynacl (#2302) - * project_loader: add build-environment part property (#2322) - * catkin, catkin-tools plugins: add support for bases (#2333) - * schema, meta: support layout (#2338) - * schema, meta: support app command-chain (#2341) - * schema, meta: add "full" app adapter (#2343) - * ruby plugin: add support for base (#2346) - * extensions: support adding root properties (#2347) - * extensions: remove root extensions (#2348) - * extensions: use extension docstring (#2349) - * extensions: parse all declared extensions before applying (#2350) - * extensions: cleanup and generic tests (#2355) - * {make,cmake,autotools} plugin: add support for bases (#2363) - * qmake plugin: add support for bases (#2366) - * {kbuild,kernel} plugin: add support for bases (#2368) - * tests: add spread test exercising multipass build VMs (#2367) - * plugins: remove jhbuild (#2371) - * rust plugin: add support for bases (#2373) - * sanity checks: verify that command-chain is not used with legacy adapter (#2375) - - [ Evan Dandrea ] - * cli: use the better snapcraft.io/account URL (#2280) - - [ Adam Collard ] - * storeapi: use structured data for the conflicted current value (#2316) - - [ Erik Berkun-Drevnig ] - * rust plugin: do not ignore the cross compile target (#2264) - - [ Anthony Fok ] - * nodejs plugin: add support for ppc64el and s390x (#2310) (#2310) - * nodejs plugin: update to the latest 8.x LTS version (#2342) - - [ John Lenton ] - * yaml: replace yaml.safe_load() with CSafeLoader (#2218) - - -- Sergio Schvezov Sat, 20 Oct 2018 18:41:17 +0000 - -snapcraft (2.43.1) xenial; urgency=medium - - [ Sergio Schvezov ] - * lxd: support new style snap injection (#2222) - * snap: prepare override scripts to allow rebuilding (#2223) - * lxd: wait for cloud-init (#2227) - * storeapi: handle releasing to a curly braced branch (#2228) - * snap: use set-version and set-grade (#2230) - * lxd: proper filename set when using architectures (#2232) - * tests: cover manifest generation with review-tools (#2235) - * reporting: record the released version for errors (#2238) - * file_utils: find tool when using docker and deb (#2240) - * elf: better messaging on glibc ABI incompatibilities (#2241) - * New upstream release (LP: #1789766) - - [ Kyle Fazzari ] - * spread: stop running catkin tests on 18.10 (#2221) - * snapcraftctl: run in isolation mode (#2224) - * templates: reimplement templates as python classes (#2226) - * templates: rename to extensions (#2233) - * cli: add list-extensions command (#2237) - * extensions: fix install path (#2236) - - [ Evan Dandrea ] - * reporting: improve messaging on errors (#2242) - - -- Sergio Schvezov Thu, 30 Aug 2018 00:08:05 +0000 - -snapcraft (2.43) xenial; urgency=medium - - [ Sergio Schvezov ] - * recording: expose the version of snapcraft (#2147) - * tests: add a fixture for OsRelease to simplify test setup - * recording: add the os-release ID and VERSION_ID to manifest.yaml - * nodejs plugin: update to the latest 6.x LTS point release (#2157) - * snap: use apt from the archive instead of compiling (#2156) - * build_providers: support for communicating with a qemu VM (#2155) - * many: refactor snapcraft.yaml loading out of load_config (#2160) - * tests: update codespell, the scope of checks and ordering of static - tests (#2162) - * rust plugin: fix cargo builds and run tests (#2170) - * build_providers: add ssh key managemet to the qemu build provider (#2168) - * ci: disable osx tests until a new pyyaml is released - * build_providers: inject snaps when running from a snap (#2174) - * code: use black as the standard style (#2180) - * cli: reserve the --debug option for snapcraft projects (#2185) - * state: allow parametrization of the global state file (#2186) - * errors: enable sentry by default (#2187) - * file_utils: get_tool_path to always return an absolute path (#2193) - * errors: support keyboard interrupts (#2198) - * build_providers: add a build image setup facility (#2192) - * build providers: better injection logic (#2196) - * Revert "ci: disable osx tests until a new pyyaml is released" (#2213) - * providers: multipass by default on darwin (#2215) - * New upstream release (LP: #1787419) - - [ Kyle Fazzari ] - * lifecycle: automatically stage dependencies (#2144) - * lifecycle: automatically clean dirty steps (#2145) - * travis: use LXD from 3.0 track (#2149) - * project_loader: process parts in consistent order (#2146) - * project_loader: allow loading null parts (#2153) - * tests: disable sentry (#2154) - * lifecycle: don't clean priming area if the snap is being tried (#2143) - * many: extract lifecycle ordering into own module (#2159) - * many: automatically redo step for specified part (#2152) - * tests: add lifecycle ordering tests (#2163) - * many: automatically detect dependency changes (#2165) - * project_loader: replace dict keys as well as values (#2166) - * {catkin,python} plugin: support cleaning (#2171) - * many: add shellcheck to static tests (#2172) - * lifecycle: detect local source changes (#2167) - * lifecycle: pass commands to containerbuild, not steps (#2178) - * cli: SNAPCRAFT_BUILD_ENVIRONMENT isn't deprecated (#2179) - * pluginhandler: use uname from the host (#2177) - * store: properly handle disabled deltas (#2181) - * tests: create basic integration test spread infrastructure (#2173) - * tests: add spread suite for autotools plugin (#2182) - * tests: add spread suite for cmake plugin (#2183) - * spread: stop testing 17.10 (#2197) - * tests: add spread suite for copy plugin (#2199) - * tests: add spread suite for nil plugin (#2201) - * tests: add spread suite for kbuild plugin (#2203) - * kbuild plugin: stop modifying kconfigfile (#2204) - * tests: support running spread suite in autopkgtests (#2188) - * tests: add spread suite for meson plugin (#2205) - * tests: add spread suite for godeps plugin (#2200) - * tests: add spread suite for scons plugin (#2208) - * tests: add spread suite for catkin plugin (#2206) - * tests: add spread suite for waf plugin (#2210) - * cli: add inspect subcommand (#2184) - * tests: add spread suite for tar-content plugin (#2209) - * tests: add spread suite for ament plugin (#2211) - * tests: add spread suite for ruby plugin (#2212) - * project_loader: add basic template support (#2189) - * spread tests: vendor gotty - * spread tests: vendor kbuild-template - * spread tests: vendor hello - * sentry: support disabling error reporting (#2214) - - [ Daniel Llewellyn ] - * jhbuild plugin: allow running as 'root' (#2141) - - [ Emmanuel Leblond ] - * python plugin: add process-dependency-links to the pull_properties (#2190) - * ci: improve pr template and tools' ignored files list (#2191) - - [ Celso Providelo ] - * tests: stricter match when running snapcraft revisions (#2195) - - [ Michael Vogt ] - * go plugin: do not install go debs if go snap is used (#2194) - - [ Jesse Sung ] - * kbuild plugin: read configs from source directory instead (#2202) - - [ Paolo Pisati ] - * kernel plugin: install .config as config-$kernelversion (#2207) - - -- Sergio Schvezov Thu, 16 Aug 2018 14:12:55 +0000 - -snapcraft (2.42.1) xenial; urgency=medium - - [ Sergio Schvezov ] - * repo: rollback to using dpkg-deb for deb extraction (#2111) - * pluginhandler: correctly dedent the run script (#2117) - * many: dedup environment entries (#2120) - * packaging: load the correct libraries on armhf (#2126) - * delta: properly search for in-snap xdelta3 (#2127) - * package: disable user site-packages for snapcraft (#2131) - * tests: remove obsolete env var (#2130) - * errors: generic exception for common.run[_output] (#2132) - * tests: add subprocess to lifecycle tests - * ci: resurrect codecov (#2138) - * ci: remove unused cron tests (#2139) - * tests: generalize the plainbox-provider tests - * New upstream release (LP: #1771915) - - [ Kyle Fazzari ] - * HACKING: suggest snapcraft-pr for evaluating PRs (#2108) - * repo: fix all python shebangs in stage-packages (#2112) - * sources: don't clean target for FileBase sources (#2113) - * meta: stop creating empty snap directory in prime (#2114) - * snapcraft.yaml: update apt repo location (#2124) - * file_utils: don't let FileNotFoundError escape (#2123) - * storeapi: ensure snap ID is sane before using it (#2115) - * pluginhandler: collide with directories and symlinks (#1064) - * storeapi: handle 5xx error codes for all store endpoints (#2116) - * many: introduce variables for part src and build (#2122) - * repo: automatically prune unneeded stage-packages (#2119) - - [ Christian Dywan ] - * sources: clean up IncompatibleOptionsError (#2109) - * lxd: proper error classes for container errors (#2095) - - [ Jonathan Cave ] - * plainbox-provider plugin: include pip, setuptools and wheel as stage-packages (#2140) - - -- Segio Schvezov Fri, 18 May 2018 02:28:55 +0000 - -snapcraft (2.42) xenial; urgency=medium - - [ Sergio Schvezov ] - * elf: patch everything instead of a subset of elf files (#2081) - * elf: clear the current runpath before setting the rpath (#2085) - * python plugin: properly handle distutils on bionic - * ci: add the python integration tests on bionic for travis - * many: remove support for remote lxd per project containers (#2089) - * schema: allow refresh-mode and stop-mode (#2092) - * packaging: include changelog for setup.py's version detection (#2097) - * ci: enable OSX testing on travis (#2084) - * tests: use a common cache for the integration tests - * tests: remove the SharedCache fixture and uses of it - * many: allow building in containers with no version in project (#2104) - * errors: remove logic for SNAPCRAFT_SEND_ERROR_DATA - * errors: implement the always option to sent to sentry - * package: make use of snapcraftctl snapcraft features (#2103) - * nodejs plugin: lazy load the required tarballs (#2106) - * build_providers: new build provider using multipass (#2100) - * tests: use FakeSnapd for grammar tests - * tests: adapt the integration suite to work for all releases - * New upstream release (LP: #1767016) - - [ Kyle Fazzari ] - * project_loader: support architectures for CI (#2080) - * meta: soften warning about using passthrough (#2091) - * storeapi: better handle network errors and retries (#2094) - * grammar: support compound on..to statement (#2088) - * tests: fix arch-specific integration tests - - [ Christian Dywan ] - * python: bring back support for older versions of pip (#2055) - * tests: don't use os_release and repo from snapcraft (#2096) - * lxd: wait for on-going refreshes to finish (#2098) - * ci: setup AppVeyor (#2087) - * repo: catch error updating the package cache (#2079) - * tests: do not shadow deb_arch in architecture scenarios - * tests: parser tests need the cache - * tests: don't hard-code expected arch in VersionScriptTestCase - - [ Rakesh Singh ] - * dotnet plugin: add dotnet command to path for step overriding (#1909) - - [ Michael Vogt ] - * lifecycle: skip -all-root for base snaps (#2090) - - [ Matias Bordese ] - * tests: update metadata store integration test, no previous push - required (#2086) - - -- Sergio Schvezov Thu, 26 Apr 2018 01:58:29 +0000 - -snapcraft (2.41) xenial; urgency=medium - - [ Sergio Schvezov ] - * package: ensure all relevant files are in for sdist (#2060) - * errors: enable sending tracebacks to sentry (#1961) - * errors: improve the UX for sending error data (#2024) - * errors: remove stack data when sending to sentry (#2036) - * errors: feature flag error reports (#2066) - * packaging: simplify snapcraft.yaml (#2062) - * many: update the yaml loading logic (#2065) - * extractors: support for setup.py (#2070) - * lifecycle: handle missing version correctly (#2072) - * python plugin: do not invoke wheel install if empty (#2077) - * patches: improve ctypes patch for python 3.5 - * ci: enable subset of integration tests on bionic - * errors: skip the sentry test if raven is no installed (#2075) - * New upstream release (LP: #1763934) - - [ Kyle Fazzari ] - * many: add snapcraftctl command for scriptlets (#2002) - * kernel plugin: add kmod as build-package (#2041) - * cli: support exporting login to stdout (#2043) - * many: add override-pull scriptlet (#2045) - * pluginhandler: organize in build instead of stage (#2047) - * tests: extract sources suite from general suite (#2054) - * many: add override-stage scriptlet (#2049) - * tests: extract lifecycle suite from general suite (#2057) - * many: add override-prime scriptlet (#2052) - * elf: use snapped strip (#2051) - * storeapi: properly handle lacking permission for channel (#2050) - * many: add snapcraftctl set-version (#2063) - * storeapi: handle 500 error response when releasing snap (#2059) - * states: track override scriptlets (#2068) - * many: add snapcraftctl set-grade (#2067) - * meta: validate extracted and scriptlet metadata (#2073) - - [ Christian Dywan ] - * options: introduce Project and ProjectInfo (#1995) - * lxd: friendly error with suggestions if network is broken (#1930) - * lxd: merge existing image info contents when using containerbuilds (#1997) - * lxd: specify arch in lxc image list command (#2046) - * meta: implement passthrough of properties to snap.yaml (#2053) - - [ Guilhem Lettron ] - * nodejs plugin: add option for setting npm flags (#2038) - - [ Bjorn Tillenius ] - * python plugin: install python-distutils when run on bionic (#2058) - - [ Rakesh Singh ] - * dotnet plugin: add support enable configurable runtime version for - .NET Core applications (#1911) - - [ Colin Watson ] - * storeapi: fix formatting of some store errors (#2056) - - -- Sergio Schvezov Sat, 14 Apr 2018 12:13:35 +0000 - -snapcraft (2.40.1) xenial; urgency=medium - - [ Evan Dandrea ] - * readme: polish the landing page (#2022) - - [ Christian Dywan ] - * repo: catch error due to broken build packages (#2023) - - [ Sergio Schvezov ] - * pluginhandler: organize correcly for targets with leading / (#2034) - - -- Sergio Schvezov Tue, 27 Mar 2018 21:09:24 +0000 - -snapcraft (2.40) xenial; urgency=medium - - [ Sergio Schvezov ] - * elf: better debug messages (#1950) - * elf: clear execstack by default (#1945) - * repo: silence deb caching when fetching packages (#1949) - * meta: make sure adapter does not propagate (#1955) - * store: stringify message for StoreDeltaApplicationError (#1962) - * python plugin: find setup.py when source-subdir is used (#1975) - * ci: switch to stable lxd and unconfined containers (#1978) - * project_loader: improve the logic to install patchelf as a build tool (#1967) - * demos: avoid use of the wrapper for java-hello-world (#1968) - * lifecycle: when priming dependencies need to be primed (#1977) - * pluginhandler: simplify logic when elf patching is required (#1979) - * pluginhandler: add option to disable patchelf for a part (#1987) - * schema: add keep-execstack (#1986) - * elf: remove dead code (#2000) - * core: initial support for bases (#1993) - * docker: export SNAP_ARCH into the environment (#1994) - * tests: add SNAPCRAFT_KEEP_DATA_PATH for integration (#1996) - * errros: add a specific error when running commands from plugins (#2004) - * pluginhandler: special case go patchelf failures for classic confinement (#2005) - * many: use packaging logic to get patchelf (#2006) - * project_loader: fix the host to base compatibility check (#2009) - * pluginhandler: only do elf checking and patching for type app (#2012) - * demos: use realpath in command entry for java-hello-world (#2016) - * many: optimize retrieval of the linker version (#2017) - * tests: minor fixes to autopkgtests (#2018) - * elf: avoid duplicating rpath entries (#2019) - * pluginhandler: only resort to elf mangling if the snap type is app (#2021) - * New upstream release (LP: #1756939) - - [ Leo Arias ] - * tests: split the plugins tests in the same directory (#1944) - * tests: move test files out of the snapcraft dir (#1948) - * extractors: replace desktop file ids with paths (#1879) - * extractors: add support for common-id (#1960) - * tests: remove ProjectOptions dependency from the integration suite (#1965) - * tests: remove dependency of internal repo from integration suite (#1971) - * tests: remove the internal os_release dependency (#1981) - * tests: remove _options dependency from integration suite (#1972) - * tests: update store tests user (#1984) - * tests: document arm testing setup (#1985) - - [ Kyle Fazzari ] - * catkin plugin: extract Wstool into its own module (#1927) - * elf: remove all un-primed libs from soname cache (#1980) - * catkin plugin: support recursive rosinstall files (#1934) - * elf: only set rpaths to libs of the same arch (#1988) - * elf: don't parse elf more than necessary (#1989) - * catkin plugin: replace python calls in all profile.d scripts (#2007) - * docs: add execstack to HACKING.md's list of deb deps (#2015) - * integration tests: snap tests shouldn't be arch-specific (#2014) - - [ Gustavo Silva ] - * cli: add version command (#1746) - - [ John Lenton ] - * schema: improve the snap name's validator (#1957) - * snap: actually plug the completer in. (#1956) - * tests: adapt store tests with new snap name registration error messages - (#1964) - - [ Christian Dywan ] - * project_loader: handle invalid unicode chars (#1941) - * lxd: initialize remote lazily (#1916) - - [ Celso Providelo ] - * store: support for more granular store permissions (#1958) - - [ James Henstridge ] - * elf: only consider regular files as possible ELF binaries (#1976) - * elf: only patch elf files that aren't referenced by DT_NEEDED (#1959) - - -- Sergio Schvezov Mon, 19 Mar 2018 12:40:43 +0000 - -snapcraft (2.39.2) xenial; urgency=medium - - [ Sergio Schvezov ] - * tests: improvements to demos (#1938) - * tests: remove the webcam-webui demo (#1940) - * elf: contemplate more patching scenarios (#1935) - * New upstream release (LP: #1745488) - - [ Kyle Fazzari ] - * tests: remove duplicate tests (#1928) - * schema: remove underscore from version pattern (#1933) - * store: support pushing snap with no architectures (#1937) - * storeapi: handle errors even for >400 responses (#1936) - - [ Christian Dywan ] - * sources: proper errors for invalid handlers (#1929) - - [ Sylvain Pineau ] - * tests: update the plainbox-provider tests (#1931) - - -- Sergio Schvezov Tue, 20 Feb 2018 00:40:00 +0000 - -snapcraft (2.39.1) xenial; urgency=medium - - [ Sergio Schvezov ] - * tests: setup the correct environment for adt (#1907) - * snap: patch ctypes for the snap and remove libarchive (#1915) - * tests: update tests to work in adt (#1908) - * elf: cache crawled files (#1925) - - [ Leo Arias ] - * elf: use surrogate escape when decoding readelf output (#1903) - - [ Christian Dywan ] - * os-release: stub for when /etc/os-release doesn't exist (#1880) - - [ James Henstridge ] - * elf: pyelftools to parse ELF files rather than readelf (#1913) - - [ Christian Dywan ] - * lxd: raw.idmap expects host and container id respectively (#1904) - - [ Kyle Fazzari ] - * docker: add Dockerfiles for all risk levels (#1914) - * schema: update version regex (#1924) - * mypy: update to 0.560 (#1923) - * remote_parts: handle connection errors (#1906) - - -- Sergio Schvezov Thu, 15 Feb 2018 12:14:00 +0000 - -snapcraft (2.39) xenial; urgency=medium - - [ Sergio Schvezov ] - * tests: fix broken rust test snap (#1838) - * docker: instructions to build from the snap (#1840) - * cli: implement help (#1845) - * elf: warn if primed files will not work with the base's linker (#1843) - * setup: simplify bin/snapcraft and correct tests (#1860) - * pluginhandler: patch and handle elf files on glibc mismatch - * tests: split more tests and and add an invisible ticker for travis - * tests: call file directly for the HasArchitecture checker (#1868) - * kernel plugin: remove dependency on magic (#1867) - * elf: remove dependency on magic (#1870) - * elf: cleaner patchelf experience (#1873) - * Revert "meta: create XDG_RUNTIME_DIR in wrappers. (#1818)" (#1883) - * elf: better handling for newer libc6 (#1881) - * elf: make patchelf a dependency (#1888) - * docker: user proper tags in Readme.md (#1897) - * elf: do not strip rpaths that contain $ORIGIN (#1896) - * elf: check if file exists before checking if ELF (#1901) - - [ Kyle Fazzari ] - * cli: add expiration option to export-login (#1831) - * zip: support extracting non-unix zip files (#1862) - * cli: exported login should only be readable by owner (#1869) - * lifecycle: use in-snap mksquashfs if running from snap (#1891) - * cli: use C.UTF-8 if locale not set (#1893) - * docker: beta should use beta, edge use edge (#1895) - * docker: don't rely on snapcraft-classic - * many: use in-snap unsquashfs and readelf if running from snap (#1902) - - [ Leo Arias ] - * extractors: also support appdata.xml appstream files. (#1861) - * extractors: support appstream icon and desktop (#1853) - * tests: allow to overwrite the snapcraft install command (#1894) - - [ Christian Dywan ] - * lxd: change "Terminating" message to debug level (#1842) - * lxd: use user in container when mounting remote via sshfs (#1847) - * remote_parts: Use hashed folder based on parts URI (#1856) - * grammar: to statement (#1639) - * grammar: make on statement use host architecture (#1857) - * repo: use debian.arfile instead of dpkg-deb (#1878) - * lxd: always (re-)injects snaps if necessary (#1865) - - [ Paolo Pisati ] - * kernel plugin: update initrd.img-core path to boot/initrd.img (#1839) - * kbuild plugin: pick up CROSS_COMPILE only if not empty (#1874) - - [ Alberto Donato ] - * schema: add options to configure applications socket activation (#1617) - - [ Herman Yanush ] - * cli: humanize push message (#1833) - - [ Konrad Krawiec ] - * cmake plugin: update plugin help (#1832) - * storeapi: add docstrings for _snap_index_client.py (#1855) - - [ Marcin MikoƂajczak ] - * static tests: add type hint for cli/assertions.py module (#1811) - - [ Alan Pope ] - * README: remove rocketchat link (#1854) - - [ Daniel Lim Wee Soong ] - * storeapi: add docstrings to _client (#1851) - * tests: add snap not found tests (#1849) - - [ Chris Glass ] - * cli: fixed typo in help (#1890) - - [ Jonathan Cave ] - * tests: remove plainbox part from plugin tests (#1889) - - -- Sergio Schvezov Thu, 25 Jan 2018 21:40:43 +0000 - -snapcraft (2.38) xenial; urgency=medium - - [ Sergio Schvezov ] - * ci: detect docker to auto setup core (#1801) - * ci: correctly run from snap (#1803) - * elf: strip the .note.go.buildid to make room for patching elf (#1798) - * meta: create XDG_RUNTIME_DIR in wrappers (#1818) - * tests: use a simpler test for bzr and python (#1821) - * repo: handle invalid snaps (#1815) - * tests: skip classic confined tests on armhf (#1822) - * elf: search for DT_NEEDED in prime and the base (#1823) - * pluginhandler: warn the inclusion of libraries from the host (#1829) - - [ Leo Arias ] - * tests: update the snap name already registered for store tests (#1797) - * tests: update the registered snap fake (#1799) - * tests: collect the autopkgtest results and save them to a repo (#1755) - * meta: refactor into a package (#1804) - * ci: don't fail if the snap transfer fails (#1808) - - [ Kyle Fazzari ] - * metadata: add infrastructure for extracting metadata from parts (#1825) - * extractors: support appstream metadata in parts (#1826) - - [ Michael Hudson-Doyle ] - * lxd: suppress traceback when lxc launch / init fails (#1771) - - [ Daniel Lim Wee Soong ] - * storeapi: breakdown code into modules (#1793) - - [ Tyler Hicks ] - * lifecycle: use the -no-fragments mksquashfs option (#1805) - - [ Daniel Lim Wee Soong ] - * ci: transfer generated snapcraft snap to transfer.sh (#1806) - - [ Christian Dywan ] - * repo: error for packages with broken dependencies (#1788) - * lxd: always install squashfuse (#1786) - * tests: run test_cleanbuild in LXD on Travis (#1807) - * grammar: support grammar-powered source (#1817) - - [ Ted Gould ] - * lifecycle: do not include source tarballs from previous runs (#1795) - - [ Konrad Krawiec ] - * static tests: add type hints to formatting_utils (#1809) - * tests: add more unit tests for formatting_utils (#1813) - - [ Ivan Fonseca ] - * static tests: type hinting for various modules (#1812) - - -- Sergio Schvezov Fri, 22 Dec 2017 16:55:56 +0000 - -snapcraft (2.37) xenial; urgency=medium - - [ Sergio Schvezov ] - * cli: improve the help command (#1789) - * many: set rpath for elf files for classic (#1781) - - [ Kyle Fazzari ] - * tests: run codespell as part of static tests (#1783) - * catkin-tools plugin: use stage-packages (#1779) - * cli: add export-login command (#1780) - - [ Leo Arias ] - * tests: move the ppa test trigger to lxd (#1758) - * tests: python plugin integration tests moved to a separate suite (#1791) - * tests: do not hit the network in python unit tests (#1792) - * cli: add what, why, and how to fix to the common errors (#1640) - * cli: include consistent commands to fix error conditions (#1790) - - [ Christian Dywan ] - * tests: move refresh to unit folder (#1787) - - [ Daniel Lim Wee Soong ] - * spelling: fixed spelling and added codespell support (#1770) - * cli: more complete error when registering a reserved name (#1778) - * static tests: add type hinting to file_utils.py (#1785) - - [ Sangbum Kim ] - * cli: show helpful message for 'snapcraft list-keys' with no keys (#1784) - - [ Marcin MikoƂajczak ] - * tests: add --help command to the runtests.sh script (#1775) - - [ Matias Bordese ] - * storeapi: support for pushing binary metadata (#1774) - - -- Sergio Schvezov Wed, 06 Dec 2017 15:22:05 +0000 - -snapcraft (2.36) xenial; urgency=medium - - [ Sergio Schvezov ] - * static tests: upgrade to the newest flake8 (#1745) - * static tests: enable type checking by use of mypy (#1747) - * elf: conversion from libraries (#1744) - * many: ensure classic confined binaries use the correct interpreter (#1759) - * project: export the arch triplet into the environment (#1768) - - [ Kyle Fazzari ] - * TESTING: adt on lxc requires squashfuse (#1741) - * python plugin: use extracted pip (#1607) - * ament plugin: new plugin (#1583) (LP: #1686850) - * catkin plugin: support building entire workspace (#1743) (LP: #1721168) - * store: refactor acquirement of attenuated macaroon (#1765) - * snapcraft.yaml: use gcc to determine tuple (#1764) (LP: #1733922) - - [ Leo Arias ] - * tests: reorganize unit and integration suites to make them easier to split - for travis (#1638) - * tests: share the cache for ros tests (#1725) - * tests: run daily autopkgtest in travis (#1643) - * tests: add a script to run autopkgtests from the ppa (#1749) - * tests: add the missing quote on autopkgtest run (#1756) - * tests: move the catkin integration tests to a separate suite (#1760) - - [ Chris Ratliff ] - * catkin tools plugin: add catkin tools support (#1593) - - [ Paolo Pisati ] - * kernel plugin: respect the kernel-with-firmware property (#1750) - - [ Colin Watson ] - * nodejs plugin: pass proxy configuration to yarn (#1754) - - [ Christian Dywan ] - * lxd: always remove tmp_dir after execution (#1742) - * lxd: delete container only if parts is empty (#1762) - - [ Facundo Batista ] - * store: push-metadata added (#1634) - * tests: push metadata test needs to push the snap first (#1766) - - [ Daniel Watkins ] - * python plugin: use finer grained file filters for pip (#1763) - - [ Michael Hudson-Doyle ] - * lxd: let lxd choose the architecture (#1718) - - -- Sergio Schvezov Wed, 29 Nov 2017 04:20:26 +0000 - -snapcraft (2.35) xenial; urgency=medium - - [ Sergio Schvezov ] - * pluginhandler: error out on scriptlet errors - * meta: ensure main keys are ordered in snap.yaml - * demos: remove the py?-project demos - * store: switch to new endpoints - * static: fix flake8 errors in setup.py - * docker: add the environment variable to setup core (#1576) - * cli: add the pack command (#1565) - * store: handle revoked developers (#1554) - * lifecycle: split into its own package (#1626) - * libraries: exclude the full set of libc6 (#1632) - * lxd: better surfacing of errors (#1647) - * tests: fork skip into snaps_tests (#1652) - * sources: use arfile to extract debs (#1729) - * tests: dotnet only works on 16.04 (#1732) - * unit tests: make the check for output less strict (#1738) - * New upstream release (LP: #1729417) - - [ Kyle Fazzari ] - * project_loader: aliases are deprecated - * catkin plugin: don't assume catkin is in underlay - * catkin plugin: only append PYTHONPATH if set - * plugins: extract python finder functions - * plugins: extract sitecustomize logic from python - * dirs: set plugin, schema, and library dir for snap - * plugins: extract pip from python plugin - * catkin plugin: support rosdep pip dependencies (#1581) - * plugins: add ros2 boostrapper (#1582) - * travis: run snapd tests only if not cron (#1592) - * snapcraft.yaml: don't re-use build dir (#1601) - * schema: improve invalid app, hook, and part errors (#1615) - * plugins: build-attributes is already in the state (#1620) - * tests: skip catkin test on non-xenial (#1621) - * tests: don't hit internet in ros2 units (#1619) - * states: add scriptlets to build state (#1618) - * schema: sync patterns with snapd (#1622) - * snap: remove leaking LD_LIBRARY_PATH (#1635) - * store: guide to account creation upon login (#1616) - * repo: add elementary to deb distros (#1637) - * internal: more gracefully determine host OS (#1636) - * integration tests: skip shared ROS test on non-xenial (#1656) - * internal: don't reuse variable in OsRelease (#1653) - * integration tests: remove ruby version (#1727) - * unit tests: reset log level after test (#1735) - * autotools: cross-compile using --host instead of env (#1654) - * catkin plugin: check for pip packages in part only (#1717) - * ruby plugin: be smarter about arch-specific paths (#1730) - * demo tests: bump catkin timeout by a lot (#1731) - * many: account for python shebang args in rewrite - - [ Leo Arias ] - * typo: replace ocurred with occurred - * node plugin: record installed node packages in manifest - * node plugin: record the yarn.lock file - * tests: fix the TEST_STORE environment variable - * tests: add integration tests for build snaps - * recording: record the machine information collected by uname - * tests: add unit tests for the ruby plugin - * recording: record the packages installed in the machine - * tests: simplify a little the data in nodejs unit tests - * ci: use travis conditionals - * recording: record build-snaps installed during the pull - * tests: replace the first batch of demo tests with snapd integration tests - * rust plugin: record the Cargo.lock file - * rust plugin: record the versions of rustup, rustc and cargo - * tests: move ruby demo test to snapd integration suite (#1596) - * recording: record the snaps installed on the machine (#1567) - * style: use dedent for multiline strings (#1584) - * tests: refactor the fake snapd to not hardcode values (#1569) - * code style: remove the extra quotes in the dedent example (#1594) - * recording: do not crash when snapd is not installed (#1598) - * tests: fix the skip of snapd integration tests in armhf (#1595) - * tests: fix the duplicate plainbox test scenarios (#1608) - * tests: reenable the cleanbuild integration test (#1610) - * tests: remove the duplicate nodejs integration tests (#1609) - * tests: add /snap/bin to PATH in autopkgtests (#1603) - * tests: add the slow tag for ros snapd integration test (#1602) - * lxd: fix the unit test for the user id map (#1629) - * tests: allow to select a suite when running autopkgtests (#1630) - * tests: use the snapcraft snap for the integration tests (#1625) - * tests: move the plainbox test to the integration suite (#1642) - * lxd: fix the push in container builds (#1644) - * tests: use the common base handler on the fake snapd server (#1724) - * tests: split the integration autopkgtests (#1716) - * tests: in autopkgtests, use a tempdir in home, not in the tmpfs (#1657) - * recording: record information from the image in container builds (#1633) - * recording: pass the build info flag to the container (#1736) - * tests: add the home plug to the plainbox snap (#1740) - - [ Christian Dywan ] - * lxd: mount project folder via sshfs in case of a remote (#1302) - * lxd: Only pass target arch if specified explicitly - * repo: friendly, helpful error for unsupported distros (#1586) - * lxd: instructions for /etc/sub{u,g}id after failed start (#1553) - * lxd: pass SNAPCRAFT_PARTS_URI through into container (#1585) - * lxd: use SUDO_UID for ID mapping (#1588) - * lxd: don't inject local snaps on a different arch (#1577) - * lxd: don't re-inject the same snaps (#1568) - * lxd: split container classes into different files (#1627) - * cli: update parts cache in the container (#1546) - * lifecycle: clean after deleting container (#1587) - * lxd: snapcraft refresh in containers (#1412) - * lxd: distinguish argless clean from clean -s pull (#1655) - * lxd: refresh remote container (#1739) - * cli: pass remote from container_config to clean method (#1737) - - [ Mark Lee ] - * project_loader: quote more environment variable values (#1578) - - [ James Beedy ] - * ruby plugin: new plugin - - [ Aleix Pol ] - * repo: return a proper value in DummyRepo - * common: do not fail over on empty or faulty lines in os-release - - [ Jeff Dickey ] - * ci: install git in Dockerfile for '{version: git}' usage (#1575) - - [ Michael Vogt ] - * meta: add and adapter property for apps - - [ Chris Ratliff ] - * catkin plugin: allow ROS_MASTER_URI change (#1572) - - [ Rakesh Singh ] - * dotnet plugin: new plugin (#1574) - - [ Martin Wimpress ] - * nodejs plugin: update default node engine to 6.11.4 (#1589) - - [ Colin Watson ] - * options: fix core-dynamic-linker on ppc64el/s390x (#1600) - - [ Paolo Pisati ] - * kbuild plugin: if the parts build dir already contains a .config file, return immediately (#1606) - * cross compilation: enable cross compilation of i386 kernel on x86-64 
 (#1613) - - [ Jonathan Cave ] - * plainbox-provider plugin: init PROVIDERPATH (#1611) - - [ Carlo Lobrano ] - * store: fix StoreReleaseError format for BAD REQUEST error (#1599) - * sources: get svn revision with --show-item flag (#1648) - * Removed dependency on VERSION_ID in os-release (#1623) - - [ Alfonso Sanchez Beato ] - * kernel plugin: use latest stable core snap (#1624) - - [ Nathan Haines ] - * ruby plugin: new stable release 2.4.2 (#1645) - - [ Marius Gripsgard ] - * sources: workaround for ZipFile.extractall not preserving permissions (#1723) - - -- Sergio Schvezov Wed, 01 Nov 2017 19:41:33 +0000 - -snapcraft (2.34) xenial; urgency=medium - - [ Sergio Schvezov ] - * core: cache FileBase entries when a checksum is provided (#1433) - * cli: better error message for missing mksquashfs (#1481) - * core: improve source caching logic (#1486) - * ci: speedup the CLA check (#1503) - * ci: disable the travis deploy stage for docs (#1510) - * vcs: ignore .vscode project settings (#1517) - * docs: add github processed templates (#1514) - * tour: remove the tour assets (#1520) - * project: introduce build-snaps (#1518) - * tests: update the meson test to latest meson requirements (#1532) - * jhbuild plugin: remove dependency on pkgconf (#1535) - * nodejs plugin: add prefix --prefix to global pkg add (#1539) - * New upstream release (LP: #1715399) - - [ Christian Dywan ] - * lxd: clean with no parts should only delete (#1434) - * lxd: inject snapcraft and core snaps into the container (#1364) - * lxd: wait on lock files before running apt commands (#1435) - * kbuild plugin: support Makefiles without an install target (#1432) - * kbuild plugin: move over the cross-compiling logic from the kernel plugin (#1417) - * lxd: path cannot have extra forward slashes (#1483) - * lxd: always remove existing device for project folder (#1488) - * lifecycle: outdated step should raise SnapcraftError (#1513) - * errors: introduce ContainerError (#1505) - * lxd: LXD not installed when using remote (#1516) - * lxd: use a unique temporary folder (#1519) - - [ Leo Arias ] - * recording: record the original snapcraft.yaml (#1407) - * ci: skip the CLA check for pull requests from the bot (#1482) - * docs: fix typo in plugin help (#1496) - * python plugin: record manifest (#1487) - * tests: use assertThat instead of assertEqual (#1501) - * python plugin: always record constraints and requirements contents (#1521) - * demos: update the name of the remote mqtt part (#1533) - - [ Kyle Fazzari ] - * options: properly handle missing compiler prefix (#1425) - * catkin plugin: include-roscore is a boolean (#1472) - * catkin plugin: default to release build (#1470) - * catkin plugin: rosinstall-files is a pull property (#1473) - * catkin plugin: support passing args to cmake (#1471) - * catkin plugin: extract rosdep into new package (#1392) - * cli: add global exception handler - * cli: stop handling exceptions in lifecycle - * plugins: use exceptions based on SnapcraftError - * cli: stop handling exceptions in parts - * cli: stop handling exceptions in assertions - * cli: stop handling exceptions in store - * many: use exceptions based on SnapcraftError - * rosdep: add support for multiple dependency types (#1479) - * errors: use function for exit code (#1491) - * cli: don't raise from excepthook (#1495) - * repo: make errors based on SnapcraftError (#1499) - * project loader: refactor into package (#1504) - * grammar: move into project_loader (#1500) - * many: simplify plugin loading (#1507) - * schema: version should have a max length of 32 (#1508) - * project_loader: process stage package grammar (#1509) - * project_loader: support grammar on build-packages (#1511) - - [ Alex T Newman ] - * windows: add cx_Freeze options targeting bin/snapcraft (#1478) - - [ Michael Vogt ] - * meta: add `base` as a type and top level property (#1419) - - [ Adam Collard ] - * ant plugin, gradle plugin: add support for authenticated proxies (#1490) - - [ fmanea ] - * demos: remove the unnecessary wrapper from the java demo (#1494) - - [ Neal Gompa (ăƒ‹ăƒŒăƒ«ăƒ»ă‚Žăƒłăƒ‘) ] - * repo: use os-release(5) to detect supported Linux distributions (#1527) - - [ Daniel Llewellyn ] - * jhbuild plugin: new plugin (#1298) - * jhbuild plugin: fix UnboundLocalError for chmod_path (#1534) - - -- Sergio Schvezov Wed, 06 Sep 2017 14:04:53 +0000 - -snapcraft (2.33) xenial; urgency=medium - - [ Sergio Schvezov ] - * tests: reduce the amount of test code in test_meta (#1391) - * meta: bash completion support (#1390) - * tests: fix issues with python 3.6 (#1398) - * cleanbuild: ensure we enter a shell on failures on --debug (#1404) - * tests: do not break a systems `bzr whoami` (#1357) - * snap: remove completer entry (#1409) - * core: minimal cross OS support. (#1413) - * core: a clean command should clean. (#1416) - * nodejs plugin: copy the content of out of tree symlinks (#1418) - * tests: adapt opencv's test expectations (#1426) - * New upstream release (LP: #1707060) - - [ Zygmunt Krynicki ] - * pluginhandler: don't clobber path on local import failure (#1361) - - [ Paolo Pisati ] - * core: use the correct kernel arch for s390 (#1376) - - [ Tim SĂŒberkrĂŒb ] - * core: support yaml merge tags (#1384) - - [ roxd ] - * schema: blank version should not be allowed in snapcraft.yaml (#1379) - - [ Paolo Pisati ] - * kernel plugin: add a default target per powerpc, ppc64el and s390x (#1377) - - [ Rex Tsai ] - * tests: mock download for rustup in the x-compile test. (#1396) - - [ Evan Dandrea ] - * file_utils: handle I/O errors in os.link (#1369) - * python plugin: correct capitalisation for PyPI. (#1401) - * python plugin: better explain dependency link processing (#1402) - - [ Leo Arias ] - * python plugin: output json in pip list (#1393) - * tests: allow to filter tests in docker (#1375) - * tests: document the test suites in the snapcraft repo (#1394) - * recording: rename the file to manifest.yaml (#1406) - * pluginhandler: check for collisions only in existing files (#1405) - * tests: run the tests in travis using LXD containers (#1415) - * tests: build the snapcraft snap in travis tests (#1411) - * ci: remove the old script to run with lxc (#1422) - - [ Christian Dywan ] - * cli: proper parsing of hidden options (#1378) - * core: clean the container on a full clean (#1372) - * lxd: do not assume user ID of 1000 for raw.idmap (#1385) - * autotools plugin: Enable cross-compilation support (#1383) - * lxd: distinguish FileNotFoundError for when not installed (#1400) - * waf plugin: enable cross-compilation support (#1397) - * ci: wait for apt/dpkg lock when setting lxd up (#1421) - * lxd: stop setting `$HOME` in containers (#1408) - * lxd: only remove container if one exists (#1403) - - [ Simon Davy ] - * meta: add support for `reload-command` (#1373) - - -- Sergio Schvezov Thu, 27 Jul 2017 20:19:01 +0000 - -snapcraft (2.32) xenial; urgency=medium - - [ MichaƂ Sawicz ] - * autotools plugin: don't force uniqueness on configflags (#1337) - - [ filibtester ] - * integrations: use the snapcore/snapcraft docker image in travis (#1331) - - [ Jonathan Cave ] - * sources: allow source-type to specify local (#1352) - - [ Christian Dywan ] - * tests: run unit tests on Travis with mock armhf (#1316) - * rust plugin: add support for cross-compilation (#1350) - - [ Gustavo Silva ] - * deltas: improved message returned when delta is too big (#1345) - - [ Adam Collard ] - * cli: add --version command (#1366) - - [ Sergio Schvezov ] - * cli: provide a whoami command (#1332) - - [ Kyle Fazzari ] - * cli: stop leaking green text (#1360) - * catkin plugin: add support for ROS Lunar (#1367) - - [ Leo Arias ] - * tests: use pyramid as a router for the fake servers (#1363) - * tests: set up the spread execution in linode (#1374) - * integrations: add the snapcraft Dockerfile (#1370) - * tests: refactor the travis jobs using stages (#1318) - - -- Kyle Fazzari Fri, 23 Jun 2017 10:00:19 -0700 - -snapcraft (2.31) xenial; urgency=medium - - [ Sergio Schvezov ] - * storeapi: resume snap downloads (#1330) - * cli: remove double congrats messaging (#1351) - * cli: do not duplicate errors (#1347) - * cli: default options for the implicit snap command (#1353) - * go plugin: filter the main packages when go-packages are defined (#1355) - * New upstream release 2.31 (LP: #1692102) - - [ Colin Watson ] - * store: send X-Ubuntu-Series, not X-Ubuntu-Release (#1320) - - [ Kyle Fazzari ] - * docs: improve onboarding experience (#1336) - * catkin plugin: add support for rosinstall files (#1314) - * common: find data files via sys.prefix (#1356) - - [ Tim SĂŒberkrĂŒb ] - * qmake plugin: set default qt version (#1328) - * tour: use https for source urls (#1329) - - [ Leo Arias ] - * tests: small updates for manual kernel tests (#1327) - * tests: use the fake apt cache in deb unit tests (#1334) - * state: save all the build packages as global (#1340) - - [ MichaƂ Sawicz ] - * sources: don't use --remote for updating git submodules (#1344) - - [ Christian Dywan ] - * go plugin: add support for cross-compilation (#1338) - * go plugin: cross compile with CGo (#1343) - * plugins: clarify wording of cross-compilation unsupported error (#1349) - - -- Sergio Schvezov Wed, 07 Jun 2017 22:51:40 -0300 - -snapcraft (2.30) xenial; urgency=medium - - [ Sergio Schvezov ] - * cli: new UI and internal refactor (#1307) - * cli: proper error for failed snap command (#1325) - * Revert "tests: remove the reusable parts tour test (#1321)" (#1324) - * store: collaboration UI for snaps (#1288) - * New upstream release 2.30 (LP: #1692102) - - [ Leo Arias ] - * tests: initial setup for the snapcraft snap tests with spread (#1272) - * misc: rename the snap dir variable to prime dir (#1279) - * recording: save the snapcraft.yaml in the resulting snap (#1278) - * tests: minor cleanups on the spread tests (#1287) - * tests: refactor tests with build and stage packages (#1290) - * parts: remove the deprecated snap keyword from the internal representation (#1282) - * tests: fix the recording tests to work in multiple architectures (#1292) - * recording: record stage packages installed in the snap (#1293) - * recording: record build packages installed in the snap (#1295) - * tests: increase the staging registration limit to 100 (#1271) - * tests: use C.UTF-8 for the docker locale (#1310) - * state: save the dependencies of build packages (#1299) - * recording: record global build-packages installed on the host (#1306) - * state: fix the name of the source details (#1312) - * meta: read and write the desktop file with utf-8 encoding (#1309) - * cleanbuild: set the container language to C.UTF-8 (#1304) - * tests: remove the reusable parts tour test (#1321) - * recording: save the details of the source pulled (#1317) - * state: ignore the 'any' architecture in the build packages apt cache (#1322) - * state: search for the build package that provides a virtual package (#1323) - - [ Facundo Batista ] - * store: support for channel branches in responses for release, close, and status (#1280) - - [ Christian Dywan ] - * lxd: pass through commands into the container (#1263) - * lxd: setup image and target arch for cross-compilation (#1286) - * lxd: support the architectures field from older LXDs (#1305) - * lxd: mock platform in the FakeLXD fixture (#1315) - - [ Paolo Pisati ] - * kernel plugin: learn how to assemble the ubuntu config using kconfigflavour (#1285) - * kernel plugin: slightly improve the messaging of check_config() (#1303) - * kernel plugin: do not warn about DMIID in config check (#1319) - * kernel_plugin: use CROSS_COMPILE to override the default toolchain (#1242) - * cli: allow uts machine arch as a valid --target-arch option (#1204) - * kernel plugin: verify kernel config is correct (#1223) - - [ Tim SĂŒberkrĂŒb ] - * sources: add support for 7-zip files (#1168) - - [ JulianLiu ] - * meson plugin: add a plugin for meson build system (#1294) - - [ roxd ] - * rust plugin: use of source-subdir without failing on pull (#1296) - - [ edvega ] - * sources: validate unknown source-type in yaml (#1297) - - [ Ricardo N Feliciano ] - * docs: add missing VCS dependencies to HACKING.md (#1311) - * cli: allow capital Y to accept the dev agreement (#1308) - - -- Sergio Schvezov Fri, 19 May 2017 17:39:34 -0300 - -snapcraft (2.29) xenial; urgency=medium - - [ Sergio Schvezov ] - * store: better retry strategy for GETs. (#1212) - * docs: remove docs and link to snappy-docs. (#1227) - * nodejs plugin: switch to the newer LTS. (#1228) - * pluginhandler: exclude `/snap/` from libraries. (#1231) - * nodejs plugin: switch to the newer LTS. (#1228) (#1232) - * core: find the correct libraries as a snap. (#1234) - * snap: use the gpg tarball instead of git://. (#1236) - * docs: update contribution guide. (#1233) - * repo: enable elementary. (#1237) - * cli: improve push output. (#1240) - * ci: split plugin integration tests out. (#1252) - * nodejs plugin: add support for yarn. (#1245) - * ci: fix travis ordering for locales generation. (#1254) - * core: support running from other operating systems. (#1257) - * meta: version from git support. (#1260) - * shell_utils: code cleanup (#1265) - * meta: override the version with version-script. (#1267) - * tests: fix package version pinning tests. (#1269) - * New upstream release 2.29 (LP: #1684965) - - [ Joe Talbott ] - * tests: Fix staging store test for Tracks. (#1225) - * pluginhandler: factor out state bits into the state package. (#1221) - * repo: track per-part build-packages. (#1193) - * sources: add VCS asset tracking (#1229) - - [ Facundo Batista ] - * store: better check of the error code in StatusTracker. (#1226) - - [ Leo Arias ] - * tests: add arm64 to the nightly tests (#1210) - * tests: update name registration window limit test. (#1224) - * ci: update the location of the upstream retry autopkgtests script. (#1243) - * tests: use launchpad as the source of the compressed test snap (#1259) - - [ Jumpei Ogawa ] - * repo: enable KDE Neon. (#1244) - - [ Kyle Fazzari ] - * catkin plugin: create completely valid environment (#1239) - - [ edvega ] - * help: replace dashes with underscores when printing plugins help (#1241) - * cli: remove empty lines in the unclean parts message (#1251) - - [ Celso Providelo ] - * store: new registration errors and test update. (#1247) - - [ Christian Dywan ] - * lxd: refactor Cleanbuilder into Containerbuild and add Project. (#1230) - - [ Parameswaran Sivatharman ] - * store: plumbing for collaboration support. (#1246) - - [ Colin Watson ] - * ant plugin: honour proxy configuration (#1256) - - [ Chris MacNaughton ] - * rust plugin: update plugin to set RUSTFLAGS (#1255) - - [ Andy Li ] - * docs: fixed links to doc. (#1250) - * tests: report coverage only in unit tests. (#1266) - - -- Sergio Schvezov Thu, 20 Apr 2017 13:57:08 -0300 - -snapcraft (2.28) xenial; urgency=medium - - [ Sergio Schvezov ] - * python plugin: use stage headers if applicable. (#1156) - * docs: use correct target to generate docs. (#1159) - * packaging: snapcraft as a snap (#1158) - * tour: make it work when its a snap. (#1217) - * cleanbuild: don't copy cache into container. (#1216) - * kernel plugin: fix modprobe output parsing. (#1208) - * kernel plugin: use default per arch targets. (#1209) - * python plugin: support pbr/setup.cfg projects. (#1202) - * cleanbuild: packaging independent detection. (#1199) - * tests: remove repo.Ubuntu patch for plugins. (#1194) - * store: enable delta uploads by default. (#1196) - * repo: refactor into a package. (#1192) - * core: resolve ld link first. (#1189) - * store: enable retries for store calls. (#1184) - * New upstream release 2.28 (LP: #1675391) - - [ Joe Talbott ] - * store: set User-Agent header in store requests. (#1188) - * store: Add track support to commands. (#1161) - * state: asset tracking - store versions of stage-packages. (#1142) - * store: remove 'Series' from channel map output (#1151) - * repo: support versioned stage-packages. (#1157) - * parser: use the project loader code to find the origin's snapcraft.yaml (#1141) - * cli: rename `history` to 'list-revisions' with `revisions` alias. (#1160) - * repo: add version support for build-packages (#1185) - * project: use a more likely to be found global build-package (#1218) - - [ Paolo Pisati ] - * demos: add the minimal config changes to boot a dragonboard410c (#1147) - * kernel plugin: if no dtb target is set when the arch is arm.* build them all. (#1148) - * kernel plugin: rework MAKEFLAGS from the environment (#1150) - - [ Kyle Fazzari ] - * contribution guide: add commit message template (#1153) - * demos: make ROS demos support exiting after success. (#1201) - * catkin plugin: support building with an underlay. (#1140) - * demos: add ROS content sharing demo. (#1186) - * repo: fixup with python, not sed (#1181) - * repo: ignore symlinks to libc. (#1174) - * sources: update documentation for source-subdir (#1177) - - [ Olivier Tilloy ] - * project: expose parallel_build_count to scriptlets. (#1154) - - [ Leo Arias ] - * docs: build and push the API docs to github pages. (#1126) - * tests: pass the autopkgtest secret to the container (#1162) - * tests: update the ftp source for integration test (#1169) - * ci: install wget in the container that triggers the beta tests. (#1167) - * demos: add a message to exit the mosquitto subscriber. (#1173) - * demos: add the mount-observe plug to be able to run godd. (#1172) - * tests: support bzr branches for external tests. (#1128) - * docs: update the directory where the API pages are generated (#1163) - * demos: remove the tomcat demo snap. (#1176) - * tests: make the kernel unit tests architecture independent. (#1178) - * tests: support snap directory in external tests (#1180) - * tests: run the master tests against the staging server (#1164) - * tests: take into account the new current link. (#1187) - * ci: run the CLA check in a docker container. (#1191) - * tests: add manual tests for the kernel snaps (#1198) - * ci: allow to run individual autopkgtest suites (#1200) - * tests: expect failures for the tests that can't be run in arm64. (#1145) - - [ Jonathan Cave ] - * plainbox-provider plugin: run validate (#1095) - - [ Michael Hudson-Doyle ] - * core: fix symlink resolution in get_core_dynamic_linker. (#1170) - - [ pachulo ] - * sources: add optional "source-checksum" property (#980) - - [ Colin Watson ] - * godeps plugin: add git to build-packages. (#1179) - - -- Sergio Schvezov Thu, 23 Mar 2017 16:11:14 -0300 - -snapcraft (2.27.1) xenial; urgency=medium - - [ Kyle Fazzari ] - * catkin plugin: produce build-ready staging area. (#1130) - - [ Leo Arias ] - * ci: trigger beta tests on travis every day. (#1144) - - [ Joe Talbott ] - * store: switch Track and Arch in the channel map display. (#1143) - - [ Sergio Schvezov ] - * Revert "repo: remove symlinks to libc. (#1100)" (#1146) - * New upstream release 2.27.1 (LP: #1665759) - - -- Sergio Schvezov Fri, 17 Feb 2017 19:58:48 +0000 - -snapcraft (2.27) xenial; urgency=medium - - [ Sergio Schvezov ] - * core: switch to using rpath for classic confinement. (#1094) - * python plugin: do the right thing with classic. (#1093) - * meta: support for the environment keyword. (#1103) - * meta: correct the deprecation for `setup/gui` use. (#1107) - * tests: avoid snapping progress to leak into report. (#1114) - * core: setup core to support classic confinement. (#1112) - * cleanbuild: allow talking to a remote. (#1121) - * plainbox-provider plugin: filter out sitecustomize. (#1139) - * New upstream release 2.27 (LP: #1663229) - - [ Kyle Fazzari ] - * schema,copy plugin: better errors when item has no value. (#1096) - * cleanbuild: include snap directory in tarball. (#1102) - * repo: remove symlinks to libc. (#1100) - * catkin plugin: don't pass args to setup.sh. (#1099) - * pluginhandler: support more complex stage-packages. (#1059) - * repo: cache stage packages for faster future use. (#1122) - - [ Leo Arias ] - * tests: do not rely on project_dir. (#1078) - * lifecycle: print the command needed to clean the dirty part (#1097) - * tests: check the CLA on all the commits. (#1106) - * tests: rename the integration test snaps. (#1105) - * misc: consistently use a dash for copyright years. (#1101) - * tests: rename the waf test snap. (#1111) - * ci: fix the env vars passed to the docker container in travis. (#1125) - * python plugin: exclude the RECORD files. (#1138) - - [ Marco Trevisan ] - * meta: properly get the icon extension from splitted name. (#1092) - * tests: fix or ignore PEP8 static errors. (#1085) - - [ John Lenton ] - * ux: print the version on startup when running with --debug (#1086) - - [ Dan Chapman ] - * qbs plugin: add plugin support for the Qt Build Suite (qbs). (#1079) - - [ Bayard Randel ] - * store: implement delta uploads in push. (#940) - - [ Joe Talbott ] - * store: expose store errors to the cli. (#1110) - * Make git pulls less error prone due to history changes. (#1052) - * store: add support for tracks in channels. (#1108) - - [ MZN Lab ] - * meta: allow `post-stop-command` for an app entry in `apps`. (#1109) - - [ LoĂŻc Minier ] - * kernel plugin: fix kernel snap layout (#1115) - - -- Sergio Schvezov Thu, 09 Feb 2017 12:55:44 +0000 - -snapcraft (2.26) xenial; urgency=medium - - [ Sergio Schvezov ] - * misc: remove snapd "submodule". (#1051) - * meta: ensure snap.yaml is desktop free. (#1053) - * godeps plugin: support for go-packages. (#1057) - * store: proper error colors for login failures. (#1055) - * project: snapcraft.yaml in a snap directory. (#1073) - * project: new plugin directory location. (#1082) - * project: support for gui in snap. (#1083) - * New upstream release 2.26 (LP: #1656291) - - [ Shawn Wang ] - * store: fix sso_host for dev sso. (#1031) - - [ Matthew Aguirre ] - * gradle plugin: update gradle plugin to support both gradle and - gradlew. (#1024) - - [ Leo Arias ] - * ci: use python2 to check the CLA (#1044) - * ci: remove the old tarmac file. (#1072) - * ui: add a space after the developer agreement prompt (#1065) - * tests: use a temporary directory for snaps tests. (#1068) - * tests: increase the timeout for the ros snap test, decrease the rest (#1067) - * tests: add ubuntu user to sudoers on every adt platform. (#1091) - - [ Kyle Fazzari ] - * schema: print allowed length for length failures. (#1056) - * tour: add g++ as dependency to 01-reusable-part. (#1062) - * file_utils: copy symlinks to directories as symlinks. (#1063) - * repo: add multiarch support for stage packages. (#1050) - * catkin plugin: don't stage compilers. (#1070) - * sources: preserve symlinks to directories. (#1081) - - [ Bjorn Tillenius ] - * python plugin: download all python packages using one command. (#1071) - - [ Olivier Tilloy ] - * meta: proper Exec key in desktop files for apps named like their parent - package. (#1061) - * meta: rename desktop files to match the app names. (#1074) - - [ Marco Trevisan ] - * options: use actual userspace architecture for building in 32bit (#1060) - * autotools plugin: extend Make plugin instead of repeating code (#1076) - - [ Daniel Watkins ] - * tests: don't wait for lxd networking in cleanbuild test. (#1087) - - [ Joe Talbott ] - * parser: handle parser and network errors. (#1045) - * parser: use an XDG directory for sources. (#1032) - * parser: return an error code if an origin is missing a part. (#1058) - - -- Sergio Schvezov Fri, 27 Jan 2017 20:38:10 +0000 - -snapcraft (2.25) xenial; urgency=medium - - [ Joe Talbott ] - * parser: better message for missing snapcraft.yaml in origins. (#985) - * parser: clean up help. (#986) - * parser: improve output. (#984) - * pluginhandler: ensure staged files are included in the prime step. (#920) - * tests: add aliases integration test. (#1004) - - [ Matthew Aguirre ] - * Update ant plugin to use get_build_properties(). (#991) - * Updated autotools plugin to use get_build_properties(). (#999) - * godeps plugin: update godeps plugin to use get_pull_properties(). (#1000) - * catkin plugin: update catkin plugin to use get_pull_properties(). (#1001) - * make plugin: update make plugin to use get_build_properties(). (#992) - * nodejs plugin: update nodejs plugin to use get_build_properties(). (#996) - * go plugin: update go plugin to use get_build_properties(). (#997) - * python plugin: update python plugin to support get_pull_properties(). (#1002) - * qmake plugin: update qmake to use get_build_properties() and - get_pull_properties(). (#993) - * gulp plugins: update gulp plugin to use get_build_properties(). and - get_pull_properties(). (#998) - * kernel plugin: update kernel plugin to use get_build_properties(). (#995) - - [ Kyle Fazzari ] - * copy plugin: update copy plugin to use get_build_properties(). (#1022) - * tests: add alias integration test. (#1021) - * sources: support symlinks in deb sources. (#941) - * schema: replace `snap` filter with `prime` filter. (#1006) - * tests: reorganize plugin tests into subdirectory. (#1014) - * tests: reorganize command tests into subdirectory. (#1015) - * tests: reorganize state tests into subdirectory. (#1019) - * pluginhandler: add support for disabling system library migration. (#989) - * docs: document the `notify` daemon type. (#1041) - * docs: describe hooks. (#1042) - * lifecycle: clean without parsing if possible. (#1007) - * core: add support for hooks. (#1026) - - [ Marco Trevisan ] - * travis.yaml: use docker exec to split build phases. (#1012) - - [ Leo Arias ] - * tests: fix integration tests in armhf. (#971) - * ci: add a checklist in the pull request template. (#972) - * ci: check the license agreement on Travis. (#973) - * tests: fix snaps tests in armhf. (#990) - * rust plugin: add conditional compilation. (#1029) - * tests: use rust 1.12 to test the rust-revision in armhf. (#1040) - * rust plugin: use the part source path. (#1035) - * misc: delete bzr ignore. (#1038) - - [ Jonathon Love ] - * nodejs plugin: fix the plugin’s dependency installation. (#1023) - - [ Olivier Tilloy ] - * meta: add 'desktop' entry for apps. (#1010) - - [ Sergio Schvezov ] - * project loader: better error message for classic. (#1025) - * tests: fix broken unit test in master. (#1027) - * parts: better error message when defining parts. (#1036) - * schema: support the notify daemon type. (#1037) - * godeps plugin: work when GOBIN is set. (#1046) - * meta: support core libraries. (#1047) - * docs: update deprecation links. (#1048) - * rust plugin: respect fetch parameters. (#1034) - * New upstream release 2.25 (LP: #1656291) - - [ Bayard Randel ] - * store: implement push pre-check. (#1009) - - -- Sergio Schvezov Fri, 13 Jan 2017 12:07:10 +0000 - -snapcraft (2.24) xenial; urgency=medium - - [ Sergio Schvezov ] - * meta: support classic confinement (#946) - * project: support building classic snaps (#949) - * pluginhandler: convert to package (#954) - * tests: idempotent store installs. (#956) - * demos: do not force arch for the tomcat demo (#976) - * pluginhandler: install scriptlet support (#960) - * pluginhandler: prepare scriptlet support (#987) - * pluginhandler: build scriptlet support (#988) - * New upstream release 2.24 (LP: #1650632) - - [ Leo Arias ] - * tests: fix unittests for armhf (#945) - * tests: Use a more stable ftp source (#950) - * tests: use testtools as the base of all unit tests (#948) - - [ Marco Trevisan ] - * parser: add support for origin-{branch,commit,tag} (#931) - - [ Chris MacNaughton ] - * rust plugin: fetch dependencies in pull (#908) - - [ Larry Price ] - * file_utils: catch PermissionError when attempting to replace contents in - a readonly file (#892) - - [ Albert Astals Cid ] - * sources: add source value to error message (#958) - * cli: make plugins be an alias of list-plugins (#959) - - [ Joe Talbott ] - * meta: add `aliases` support to `apps` (#947) - * parser: Use the same version method as 'snapcraft' (#982) - - [ Kyle Fazzari ] - * sources: convert to package. (#955) - * sources: refactor base sources into module. (#957) - * sources: refactor bazaar source into module. (#962) - * sources: refactor deb source into module. (#963) - * sources: refactor local source into module. (#961) - * sources: refactor git source into module. (#964) - * sources: refactor mercurial source into module. (#965) - * sources: refactor rpm source into module. (#966) - * sources: refactor script source into module. (#967) - * sources: refactor subversion source into module. (#968) - * sources: refactor tar source into module. (#969) - * sources: refactor zip source into module. (#970) - * pluginhandler: prefer in-snap libraries to system libraries. (#977) - - [ Celso Providelo ] - * cli: implementing '[list-]registered' command (#890) - * store: support download and validate on branded stores. (#981) - - [ Matthew Aguirre ] - * maven plugin: implement get_build_properties() (#974) - * gradle plugin: implement get_build_properties() (#975) - * cmake plugin: implement get_build_properties() (#978) - * waf plugin: implement get_build_properties() (#979) - * scons plugin: implement get_build_properties() (#983) - - -- Sergio Schvezov Fri, 16 Dec 2016 17:10:40 +0000 - -snapcraft (2.23) xenial; urgency=medium - - [ Sergio Schvezov ] - * indicators: work with Content-Encoding set (#896) - * store: download without login (#903) - * readme: rocket instead of irc (#907) - * indicators: support TERM=dumb (#906) - * Update HACKING.md (#910) - * help: update stage-packages and build-packages (#913) - * meta: icon is now dedeprecated (#914) - * cache: cleanup logic to pass project name (#915) - * sources: missing command instead of package (#916) - * docs: update GUI related integrations (#919) - * pluginhandler: source management moved to the core (#923) - * store: return specific error when already owned (#942) - * nodejs plugin: install during pull to support npm run (#936) - * New upstream release 2.22.1 (LP: #1646993) - - [ Parameswaran Sivatharman ] - * store: login with option to agree to terms of service and human friendly errors (#866) - - [ Bayard Randel ] - * cache: snap revision caching on 'push'. (#889) - * deltas: migrate from xdelta to xdelta3. (#934) - - [ Leo Arias ] - * tools: new script to retry autopktests (#893) - * tests: remove the outdated all snaps image set up for snaps tests (#911) - * plugin: add a gradle demo and test (#912) - * tests: unset the proxies for gradle unit testing (#922) - * tests: use the connectivity check page to test the downloader snap (#925) - * tests: add a script to build external snaps (#927) - * tests: replace coveralls with codecov (#939) - * tests: replace subTests with TestScenarios (#943) - - [ Marco Trevisan ] - * repo: apt-mark new build-packages as automatically installed (#891) - * sources: add ftp support (#900) - * parser: support remote dependencies (#930) - * sources: add current dir to ignore list if we're iterating on parent (#926) - - [ Kelvin Li ] - * cache: enable prune for snap cache. (#905) - * deltas: initial implementation (#918) - - [ Celso Providelo ] - * cli: basic 'enable-ci' implementation. (#901) - * cli: implement `enable-ci travis --refresh` command (#932) - - [ John Lenton ] - * cli: _filedir takes an extension, not a glob (#933) - - [ Larry Price ] - * cmake plugin: utilize MakePlugin build logic within CMakePlugin (#935) - - [ Kyle Fazzari ] - * pluginhandler: incorporate all part properties into state tracking. (#937) - - -- Sergio Schvezov Fri, 02 Dec 2016 23:44:19 +0000 - -snapcraft (2.22.1) xenial; urgency=medium - - * Revert "Allow for architecture-specific packages (#876)" (#898) - * New upstream release 2.22.1 (LP: #1640585) - - -- Sergio Schvezov Fri, 11 Nov 2016 19:28:41 +0000 - -snapcraft (2.22) xenial; urgency=medium - - [ Sergio Schvezov ] - * Support for gadget snaps (#886) - * Remove license concepts (#880) - * store: send snapcraft version in a header (#894) - - - [ Bayard Randel ] - * repo: cache apt related files (config, packages) in 'apt' parent - directory. (#887) - - [ Kyle Fazzari ] - * catkin plugin: python nodes require gcc/g++ too. (#881) - - [ Neal Gompa ] - * sources: Add RPM source (#870) - - [ StĂ©phane Graber ] - * Always respect go-buildtags (#888) - * Allow for architecture-specific packages (#876) - - -- Sergio Schvezov Wed, 09 Nov 2016 19:50:29 +0000 - -snapcraft (2.21) xenial; urgency=medium - - [ Sergio Schvezov ] - * pluginhandler: parametrize call args (#868) - * python plugin: wheel and install in the proper order (#883) - * New upstream release 2.21 (LP: #1638513) - - [ StĂ©phane Graber ] - * sources: Add new `source-commit` field for VCS sources (#877) - - [ Kyle Fazzari ] - * python plugin: remove pip packages when cleaning pull. (#882) - - [ Chris Wayne ] - * Add some further bash-completion (#872) - - -- Sergio Schvezov Wed, 02 Nov 2016 10:11:37 +0000 - -snapcraft (2.20) xenial; urgency=medium - - [ Colin Watson ] - * Add `snapcraft create-key` (#824) - - [ Kyle Fazzari ] - * catkin plugin: add `rosdistro` to help documentation. (#850) - * catkin plugin: nicely handle an invalid rosdistro. (#851) - - [ Christian Ehrhardt ] - * Add Waf plugin (#716) - - [ Maximiliano Bertacchini ] - * Add `snapcraft history`. (#844) - * Add `snapcraft status`. (#845) - - [ Daniel Holbach ] - * Document the `grade` option. (#857) - - [ Celso Providelo ] - * Implementing channel-closing. (#847) - * `sign-build` to prompt users for key selection (#848) - * history/status alignment fixes. (#863) - - [ Leo Arias ] - * In the downloader demo test, use https (#860) - - [ StĂ©phane Graber ] - * Add powerpc (32bit big-endian) support (#862) - - [ Roberto Alsina ] - * gated and validate commands message improvements (#849) - * Handle 'broken' validations that don't match refresh-control (#867) - - [ Domas Monkus ] - * go plugin: Set GOBIN in the build environment. (#859) - - [ Robert Ancell ] - * Update documentation links to developer.ubuntu.com that now redirect to - snapcraft.io (#864) - - [ Daniel Holbach ] - * Bring docs/upload-your-snap.md in line with http://snapcraft.io/docs/
 (#869) - - [ Sergio Schvezov ] - * Simplify the parser tests. (#852) - * Simplify the handler from uri tests. (#853) - * tools: script to talk to the staging servers (#855) - * Decouple state handling from plugin options. (#854) - * python plugin: allow usage of bzr (#858) - * python plugin: install from wheel for local setup.py (#861) - * New upstream release 2.20 (LP: #1636924) - - -- Sergio Schvezov Wed, 26 Oct 2016 13:58:31 -0300 - -snapcraft (2.19) xenial; urgency=medium - - [ Sergio Schvezov ] - * python plugin: only replace proper shebangs. (#830) - * yaml xpath for errors. (#828) - * sources: fix type when calling with depth (#829) - * kernel plugin: allow collecting the same mod deps (#837) - * pluginhandler: take the file encoding into account. (#838) - * python plugin: only download in pull and build in build. (#832) - * New upstream release 2.19 (LP: #1629472) - - [ Christopher James Halse Rogers ] - * nodejs plugin: Add mechanism to run `npm run` commands. (#810) - - [ Daniel Holbach ] - * Add links to IRC, mailing list and social media (#833) - - [ Celso Providelo ] - * 'sign-build' implementation. (#831) - - [ Kyle Fazzari ] - * catkin plugin: build with in-snap python. (#840) - * catkin plugin: Support ROS Kinetic. (#842) - - [ Roberto Alsina ] - * 'snapcraft validate' and 'snapcraft gated' implementation (#813) - - [ Joe Talbott ] - * Replace SNAPCRAFT_PART_INSTALL in the part attributes. (#841) - - -- Sergio Schvezov Fri, 30 Sep 2016 17:56:06 -0400 - -snapcraft (2.18.1) xenial; urgency=medium - - [ Carlo Lobrano ] - * snapcraft search: return ordered results (#820) - - [ Sam Yaple ] - * python plugin: Don't filter .pth files (#822) - - [ Sergio Schvezov ] - * Make copies of remote parts to avoid ordering issues (#821) - * plainbox-provider plugin: rewrite python shebangs (#823) - * New upstream release 2.18.1 (LP: #1626224) - - -- Sergio Schvezov Fri, 23 Sep 2016 13:50:26 -0300 - -snapcraft (2.18) xenial; urgency=medium - - [ Sam Yaple ] - * Check if option is url for pip (#785) - * Unify python plugin test (#793) - - [ Sergio Schvezov ] - * Improve lifecycle execution of steps (#794) - * Load project information in one location (#799) - * Replace uses of copy with dump (#798) - * Report the proper line number on bad yaml errors (#816) - * Support deb files as sources (#811) - * lxd: use built-in image streams. (#817) - * Make source-depth a parameter and opt-in (#814) - * New upstream release 2.18 (LP: #1626224) - - [ Kyle Fazzari ] - * Only discover dependencies once per file. (#796) - - [ Leo Arias ] - * In the busybox test, use the last installed data dir (#801) - * Add the TEST_STORE environment variable to the travis script (#802) - - [ Evan ] - * autotools plugin: Do not run the bootstrap directory as a script. (#803) - - [ Jonathon Love ] - * nodejs plugin: fix to install of dev-deps in package.json (#800) - - [ Colin Watson ] - * Fix parts integration tests (#807) - * Remove snapcraft.storeapi.common (#806) - * Adjust login to conform to UX specification (#804) - * Refresh discharge macaroon if necessary (#805) - - [ Joe Talbott ] - * Don't litter /tmp with test artifacts. (#808) - * Handle missing source type packages in the parser (#742) - - [ James Lucas ] - * make plugin: allow copying artifact dirs (#809) - - [ Enrique HernĂĄndez Bello ] - * Enable crosscompilation for dump and copy plugins (#791) - - [ Celso Providelo ] - * Replacing deprecated API for searching snaps. (#815) - - -- Sergio Schvezov Wed, 21 Sep 2016 15:55:08 +0000 - -snapcraft (2.17) xenial; urgency=medium - - [ Sergio Schvezov ] - * Python plugin improvements (#771) - * Organize without removing files on target (#780) - * Support globbing for organize (#784) - * New upstream release 2.17 (LP: #1621985) - - [ Leo Arias ] - * Use --force-dangerous when testing the installation of snaps (#778) - * Updated the contents of the snapcraft init template (#776) - * Add an integration test for autotools (#783) - - [ Colin Watson ] - * Implement basic form of `snapcraft register-key` (#726) - * Add `snapcraft list-keys` (#786) - - [ Joe Talbott ] - * parser - Handle project name and version variables (#773) - - [ Sam Yaple ] - * python plugin: do not compile pyc files when installing with pip (#779) - - [ Alexandre Abreu ] - * gulp plugin: fix the npm install prefix (#782) - - -- Sergio Schvezov Fri, 09 Sep 2016 19:25:24 +0000 - -snapcraft (2.16) xenial; urgency=medium - - [ Sergio Schvezov ] - * Allow registering private packages (#749) - * Allow debugging cleanbuild runs. (#740) - * storeapi: remove dependency on the 'success' attr (#750) - * Export important project variables (#757) - * Use a recursive iglob for filesets (#765) - * HACKING.md: list dependencies to install with pip (#770) - * Minor fixes for typos in --help (#769) - * Better file conflict message (#766) - * Update kernel meta to the latest spec. (#768) - * New upstream release 2.16 (LP: #1619776) - - [ Joe Talbott ] - * parser - Remove namespacing and subparts. (#705) - * Use block style for multiline YAML values. (#756) - - [ Leo Arias ] - * Enable the static checks for the integration tests (#755) - * Add the arm64 architecture to the nodejs plugin (#753) - * go plugins: remove the useless call to os.path.join (#759) - * Removed statements not used by the tests (#760) - * Make a copy of the snapcraft files common list before using it. (#767) - - [ Caio Begotti ] - * Implementing 'grade' support in snapcraft.yaml (#764) - - [ Scott Moser ] - * node plugin: run build in pull phase to download dependencies. (#762) - - [ Paolo Pisati ] - * kernel plugin: vmlinuz -> kernel.img hard link (#748) - - [ LoĂŻc Minier ] - * Include /sbin and usr/sbin in wrappers (#763) - - [ Evan Dandrea ] - * ant plugin: add properties and build target options (#752) - - -- Sergio Schvezov Fri, 02 Sep 2016 19:32:40 +0000 - -snapcraft (2.15.1) xenial; urgency=medium - - [ Robert Ancell ] - * Remove .la files generated by autotools (#670) - - [ Joe Talbott ] - * Only show chown warnings with --debug. (#739) - * Actually return a non-zero error code on errors. (#745) - - [ Sergio Schvezov ] - * make plugin: fix artifact collecting (#743) - * testing: only run the ros demo on xenial (#744) - * New upstream release 2.15.1 (LP: #1614322) - - -- Sergio Schvezov Fri, 19 Aug 2016 13:43:42 -0300 - -snapcraft (2.15) xenial; urgency=medium - - [ Harald Sitter ] - * add multiple generator script options to autotools (#679) - - [ Sam Yaple ] - * python2 plugin: Add support for constraints (#657) - - [ Blake Rouse ] - * Add option disable-parallel for all plugins. (#698) - * python3 plugin: allow setup.py to work on some projects. (#718) - - [ Christian Ehrhardt ] - * fix checker errors to let runtests.sh pass again (#717) - - [ Dan Watkins ] - * python plugins: add process-dependency-links option (#734) - - [ Leo Arias ] - * Start the fake parts server only in the tests that need it. (#720) - (LP: #1611828) - * In travis, install the static checkers with pip. (#724) - * go plugin: add a go-buildtags property to the plugin (#733) - - [ Joe Talbott ] - * Set owner/group for directories in stage and prime (#723) - * parser - Return non-zero code for wiki errors. (#658) - * Factor parts config into snapcraft/internal/parts.py (#731) - - [ Kyle Fazzari ] - * Use link_or_copy instead of just hard-links for deb cache. (#728) - * Support having the snapcraft.yaml in a subdir. (#725) - * Dump plugin: Don't remove install directory. (#729) - - [ Jason Hobbs ] - * Add artifacts option to make plugin. (#715) - - [ Michael McCracken ] - * Clarification of make plugin help text (#730) - - [ Sergio Schvezov ] - * Globally cache stage-packages (#677) - * Remove store dispute logic (#732) - * New upstream release 2.15 (LP: #1614322) - - -- Sergio Schvezov Wed, 17 Aug 2016 17:47:44 -0300 - -snapcraft (2.14) xenial; urgency=medium - - [ Joe Talbott ] - * Add python package dependencies to setup.py (#550) - * parser - Support .snapcraft.yaml files. (#618) - * Preserve file ownership for 'os' snaps. (#690) - - [ Marius Gripsgard ] - * Add new plugin: rust (#579) - - [ Sam Yaple ] - * Fix python2 compile cache removal (#660) - * Improve python2 test coverage (#663) - - [ StĂ©phane Graber ] - * Implement "oneshot" daemon type (#693) - - [ Bogdana Vereha ] - * Replace 'strip' with 'prime' on intro page and step options. (#696) - - [ Kyle Fazzari ] - * Rewrite shebangs generated by the python plugins. (#680) - * Add godeps plugin. (#691) - * Catkin plugin: Enforce C.UTF-8 locale. (#497) - - [ Blake Rouse ] - * Pass --root to the python3 plugin on build (#694) - * Add make-install-var field to the make plugin. (#711) - - [ Sebastian Bacher ] - * Use the new snapcraft.io mailing list as contact information (#702) - * Update the completion list of commands (#703) - * Slightly tweak the "no jar files" errors (#704) - - [ Liu XiaoGuo ] - * Added "camera" plug into the example (#706) - - [ Simon Quigley ] - * Update the debian/control file (#662) - * Add detection for an existing `.snapcraft.yaml` file before running - `snapcraft init` (#669) - - [ Michael Hall ] - * Strip common path prefixes from linkname as well as name when extracting - a tarfile. (#688) - - [ Leo Arias ] - * Use requirements files in travis tests (#656) - * Enable integration tests to run in the production store (#687) - - [ Daniel Watkins ] - * Make formatting of daemon options consistent (#710) - - [ Sergio Schvezov ] - * Run tests from /tmp (#684) - * Use the proper requirements.txt path (#707) - * Improve the go plugins usability (#709) - * kernel plugin: kernel targets depending on debarch (#689) - * New plugin: dump (#712) - * rust plugin: mock downloads in unit tests (#713) - * New upstream release 2.14 (LP: #1611009) - - -- Sergio Schvezov Mon, 08 Aug 2016 14:58:39 +0000 - -snapcraft (2.13.1) xenial; urgency=medium - - [ Joe Talbott ] - * parser - Add handling for carriage returns in wiki (#681) - - [ Sergio Schvezov ] - * New upstream release 2.13.1 (LP: #1605107) - - -- Sergio Schvezov Mon, 25 Jul 2016 13:27:29 +0200 - -snapcraft (2.13) xenial; urgency=medium - - [ Colin Watson ] - * Make maven plugin honour https_proxy and proxy authentication (#642) - - [ Dustin Kirkland ] - * add a link for filing bugs/issues (#647) - - [ Joe Talbott ] - * parser - Handle malformed wiki entries. (#636) - * Use '/usr/bin/env python3' (#649) - * parser - Don't allow duplicate wiki entries. (#613) - * Preserve the ordering of the wiki entries (#596) - - [ Leo Arias ] - * Add the test for the downloader snap (#589) - * Do not clean before running the snaps tests (#637) - - [ Jonathan Cave ] - * Create Plainbox Provider plugin (#609) - - [ Matthew Aguirre ] - * ant plugin: use python std libraries and add tests (#644) - * new plugin: gradle (#651) - * maven plugin: support maven targets (#650) - * Put options before jar task in command. (#655) - - [ Kyle Fazzari ] - * Support "never" as a daemon restart condition. (#659) - - [ Simon Quigley ] - * Fix four typos in `snapcraft help` (#667) - - [ Robin Winslow ] - * Fix broken links to https://snapcraft.io (#665) - - * Implemented `snapcraft release` (#648) - * Implement `snapcraft push` (#653) - * Allow / in parts (#666) - * Capture the correct exception when not being able to decode json (#672) - * Special handling for pc files for conflicts (#676) - * New upstream release 2.13 (LP: #1605107) - - -- Sergio Schvezov Thu, 21 Jul 2016 08:12:25 +0000 - -snapcraft (2.12.1) xenial; urgency=medium - - * New upstream release 2.12.1 (LP: #1600090) - - -- Sergio Schvezov Fri, 08 Jul 2016 13:31:34 -0300 - -snapcraft (2.12) xenial; urgency=medium - - [ Simon Quigley ] - * Change apt-get to apt in HACKING.md (#564) (LP: #1591421) - * Changed the mailing list in HACKING.md from snappy-devel to snapcraft - (#577) - * Add Subversion support (#567) (LP: #1543243) - - [ Joe Talbott ] - * Include 'maintainer' and 'description' in the parser output. (#565) - (LP: #1591199) - * Support "```" wiki code tags in the parser. (#569) (LP: #1592133) - * Add snapcraft-parser integration test. (#560) (LP: #1590268) - * Make most wiki fields required. (#581) (LP: #LP: #1592133) - * Add more info about reusable parts. (#527) (LP: #1582499) - * Allow parts without a 'source' entry. (#599) - - [ Sergio Schvezov ] - * New plugin: gulp (#563) (LP: #1575880) - * Support for a hidden snapcraft.yaml (#582) (LP: #1587933) - * Implement `snapcraft update` for parts (#588) (LP: #1594643) - * Support updating cache without content-length (#598) (LP: #1595610) - * Switch from local copy to the proper python package. (LP: #1590813) - * Integrate with new remote parts (#590) (LP: #1594976) - * Implement `snapcraft define` for parts (#594) (LP: #1594643) - * Update the remote parts cache before demo tests (#604) (LP: #1596114) - * Add missing build-packages for rpath test (#605) (LP: #1596114) - * Implement snapcraft search (#608) (LP: #1596222) - - [ Bayard Randel ] - * Ignore .eggs dir. (#572) - - [ Leo Arias ] - * Use pexpect when testing the building of snaps (#573) (LP: #1592943) - * Allow to run a subset of integration tests. (#576) (LP: #1593009) - * Improve the store errors returning exceptions (#585) (LP: #1594636) - * Add the register command (#586) (LP: #1595012) - * Improve error reporting (#591) (LP: #1588023) - * Fix the store update test to register a unique name (#595) (LP: #1595319) - * Use a xenial docker container for travis executions (#597) (LP: #1532213) - * Simplify the list plugins integration test (#607) (LP: #1596112) - * Remove the unittests from the autopkgtest execution (#600) (LP: #1596068) - - [ Evan Dandrea ] - * Make lxd containers ephemeral. (#578) (LP: #1577548) - - [ Daniel Holbach ] - * it's myapps.developer.ubuntu.com (#587) (LP: #1594844) - - [ Rob Loach ] - * Fix Snap icons for Demos (#574) - - [ Kyle Fazzari ] - * Add qmake plugin. (#566) (LP: #1574774) - * Don't copy libraries that are already in prime. (#580) (LP: #1570895) - * Make app names more restrictive. (#555) (LP: #1589613) - - -- Sergio Schvezov Mon, 27 Jun 2016 13:58:10 -0300 - -snapcraft (2.11) xenial; urgency=medium - - [ Leo Arias ] - * Make the lxd unit test pass in architectures other than amd64. (#552) - (LP: #1589747) - * Support running the snaps tests in multiple architectures (#554) - (LP: #1589779) - * Make the IsDirty unit test case pass in architectures other than - amd64. (#553) (LP: #1589752) - - [ Didier Roche ] - * Reenable get and set tourdir unit tests (#551) (LP: #1589782) - * Add finale tour examples and tests (#558) (LP: #1590903) - * Reenable tour command (#559) (LP: #1590906) - - [ Sergio Schvezov ] - * Fix or address lintian errors and warnings (#561) (LP: #1588980) - - -- Sergio Schvezov Thu, 09 Jun 2016 18:46:22 -0300 - -snapcraft (2.10.1) xenial; urgency=medium - - * Backwards compatible clean with strip (#556) (LP: #1590256) - - -- Sergio Schvezov Wed, 08 Jun 2016 16:32:27 -0300 - -snapcraft (2.10) xenial; urgency=medium - - [ Martin Wimpress ] - * Correct autotools tests to use configflags (#521) - - [ Leo Arias ] - * Run the integration tests against a local fake server when the user - password is not in the environment. (#511) (LP: #1585023) - * Move the login and logout methods to a client. (#518) (LP: #1586504) - * Improve the config handling. (#519) (LP: #1586511) - * Fix the one-time password login. (#529) (LP: #1586832) - * Moved the download to the store client. (#530) (LP: #1586836) - * Moved the upload to the store client. (#531) (LP: #1586836) - * Updated the documentation about the icon. (#542) (LP: #1578231) - * Improve the error message when a part binary is not found. (#541) - (LP: #1582367) - * Re-enable the ROS demo for autopackage testing. (#520) (LP: #1588098) - * Add macaroon support to login, upload and download. (#532) (LP: #1586910) - * Set the no_proxy environment variable to access the local fake servers. - (#546) (LP: #1588631) - - [ Stephen Stewart ] - * nodejs plugin: Support configurable node version (#509) (LP: #1586104) - - [ Kyle Fazzari ] - * Use correct cross-build packages for ppc64le. (#539) (LP: #1570944) - - [ Sergio Schvezov ] - * Support zip files as source (#523) (LP: #1577062) - * A nicer error message for incorrect stage-packages (#524) (LP: #1568131) - * Support the assumes keyword (#525) (LP: #1586429) - * Improve the template for snapcraft init (#528) (LP: #1575581) - * Filter out *.snap from sourcedir (#535) (LP: #1575628) - * Support setting a gopath for a go project from vcs (#538) (LP: #1583426) - * Add a ticker for snapping (#540) (LP: #1582955) - * Rename strip to prime (#543) (LP: #1582515) - - [ Didier Roche ] - * Wrap plugin list output content (#534) (LP: #1587057) - * Add snapcraft examples to scaffold getting started tour (#513) - (LP: #1586137) - - [ Joe Talbott ] - * Add support for parsing the parts wiki (#545) (LP: #1587583) - - -- Sergio Schvezov Fri, 03 Jun 2016 13:37:58 -0300 - -snapcraft (2.9) xenial; urgency=medium - - [ Leo Arias ] - * autopkgtests: run the install examples tests in classic. (#481) - (LP: #1572764) - - [ Matteo Bertini ] - * Fix typo in description of the python3 example. (#504) - - [ Jamie Bennett ] - * Documentation: Use plugs instead of caps. (#507) - - [ Chris Wayne ] - * Add in bash completion. (#453) (LP: #1570506) - - [ Sergio Schvezov ] - * Fail validation if plugs or slots are declared at the part level (#514) - (LP: #1581166) - - [ Kyle Fazzari ] - * Make pull and build steps dirty if target arch changes. (#450) - (LP: #1564192) - * Add support for the confinement property. (#501) (LP: #1580819) - * Add support for the epoch property. (#502) (LP: #1581113) - - -- Sergio Schvezov Tue, 24 May 2016 23:32:11 -0300 - -snapcraft (2.8.8) xenial; urgency=medium - - * Create the 'partial' directory for apt. (#499) (LP: #1578007) - - -- Sergio Schvezov Wed, 04 May 2016 14:22:58 -0300 - -snapcraft (2.8.7) xenial; urgency=medium - - * Don't fail if there is no system library list (#496) (LP: #1577750) - - -- Sergio Schvezov Tue, 03 May 2016 10:58:57 -0300 - -snapcraft (2.8.6) xenial; urgency=medium - - [ Leo Arias ] - * Import mock from unittest. (#492) (LP: #1576998) - - [ Sergio Schvezov ] - * Remove missing replacement for unittest.mock (#494) (LP: #1576998) - - -- Sergio Schvezov Sat, 30 Apr 2016 18:44:44 -0300 - -snapcraft (2.8.5) xenial; urgency=medium - - [ Leo Arias ] - * autopkgtests: run the tests using the installed package (#464) - (LP: #1570992) - * Remove --allow-unauthenticated from examples tests (#482) (LP: #1573211) - * Update the assertion of the example install (#483) (LP: #1573243) - * Examples tests: Update the path to the snaps binaries (#484) (LP: #1573349) - * Examples tests: use systemctl instead of the removed snap service (#485) - (LP: #1573697) - * Update the mosquitto example SNAP_USER_DATA path. (#486) (LP: #1574857) - * Update the busybox test to use the snap data path. (LP: #1574901) - * Remove the integration tests coverage. (#488) (LP: #1575383) - - [ Sergio Schvezov ] - * Don't clean target before extracting npm (#489) (LP: #1575876) - * Don't delete the nodejs download on build. (#490) (LP: #1575882) - - [ Vincent Ladeuil ] - * Make upload more robust by ignoring spurious errors while polling the - scan status. (#480) (LP: #1572963) - - [ Kyle Fazzari ] - * docs/get-started.md: Stop discussing snappy-tools. (#454) (LP: #1568113) - - -- Sergio Schvezov Fri, 29 Apr 2016 14:59:47 -0300 - -snapcraft (2.8.4) xenial; urgency=medium - - [ Sergio Schvezov ] - * Use series 16 by default instead of rolling-core (#477) (LP: #1572602) - * kernel plugin: iterate over modules to add to initrd (#476) (LP: #1572118) - - [ Kyle Fazzari ] - * Follow symlinks while hard-linking migrated files. (#478) (LP: #1572664) - - -- Sergio Schvezov Wed, 20 Apr 2016 19:15:32 -0300 - -snapcraft (2.8.3) xenial; urgency=medium - - [ Kyle Fazzari ] - * docs/intro.md: Fix broken developer reference link. (#456) (LP: #1558296) - * Nil plugin: Make purpose more clear in documentation. (#455) (LP: #1549691) - * Use colors for logging. (#474) (LP: #1572186) - - [ Leo Arias ] - * Update the snapcraft-coverage script to use the internal dirs (#471) - (LP: #1571696) - - [ Sergio Schvezov ] - * Fix shell quoting (#473) (LP: #1572129) - - -- Sergio Schvezov Tue, 19 Apr 2016 17:59:45 -0300 - -snapcraft (2.8.2) xenial; urgency=medium - - * Don't expose broken or fragile APIs to plugins (LP: #1571264) - * catkin plugin: use ProjectOptions for repo setup (#468) (LP: #1571446) - * qml plugin: remove broken plugin (#469) (LP: #1551343) - - -- Sergio Schvezov Mon, 18 Apr 2016 10:06:15 -0300 - -snapcraft (2.8.1) xenial; urgency=medium - - [ Simon Busch ] - * Correctly pass arguments to Cleanbuilder (#458) (LP: #1570706) - - [ Sergio Schvezov ] - * Only add cross build packages when cross compiling. (#451) (LP: #1570414) - * Fix store downloading (#452) (LP: #1569734) - - [ Kyle Fazzari ] - * Add support for s390x architecture. (#461) (LP: #1570835) - * Add SNAP_LIBRARY_PATH to LD_LIBRARY_PATH. (#462) (LP: #1570945) - * Kernel plugin: Support lzma/xz-compressed initrd. (#463) (LP: #1569337) - - -- Kyle Fazzari Fri, 15 Apr 2016 23:35:47 +0000 - -snapcraft (2.8) xenial; urgency=medium - - [ Didier Roche ] - * Support .git extension detection (LP: #1566153) - - [ Kyle Fazzari ] - * Copy plugin: Follow symlinks if outside of snap. (LP: #1532515) - * Lifecycle: Check to see if prerequisite is already built. (#431) - (LP: #1537790) - * Clean command: Don't automatically clean reverse dependencies. (#436) - (LP: #1568004) - * Library crawling: Make ldd failure non-fatal. (#440) (LP: #1569280) - * Automatically re-strip if dirty. (#442) (LP: #1477904) - * Automatically re-stage if dirty. (#443) (LP: #1477904) - * Detect dirty build step. (#447) (LP: #1477904) - * Detect dirty pull step. (#448) (LP: #1477904) - - [ Sergio Schvezov ] - * Precedence and library path ordering. (LP: #1548232) - * Converge all commands into one (#433) (LP: #1567058, #1567041) - * Make geoip optional and local sources a default (#430) - (LP: #1536691, #1561068) - * Remove global state attributes from snapcraft.common (#434) (LP: #1551849) - * Remove support and mentions of the config hook. (#437) (LP: #1568826) - * Remove `old-security`. Use proper interfaces. (#441) (LP: #1569452) - * Make meta a class in snapcraft.internal.meta (#444) (LP: #1551849) - * Move common directories to ProjectOptions (#445) (LP: #1551849) - * debian/control: Update Standards-Version. - - [ Leo Arias ] - * Add a test for the mosquitto example. (#418) (LP: #1564181) - * Update the snap command in examples tests. (#439) (LP: #1569401) - - [ Vincent Ladeuil ] - * VCS tools are test dependencies, they should be installed to run the - tests or the tests should be skipped. (#427) (LP: #1566882) - - -- Sergio Schvezov Wed, 13 Apr 2016 21:37:32 -0300 - -snapcraft (2.7) xenial; urgency=medium - - [ Joe Talbott ] - * make plugin: Add 'make_parameters' option. (LP: #1563535) - - [ Sergio Schvezov ] - * Clear icon path before trying to write the new one (LP: #1561331) - * Raise a nice error when downloading without a login (LP: #1560553) - * Explain the new way to provide snap icons. (LP: #1561327) - * Redo pkg-config handling with library collecting (LP: #1549570) - * Properly validate the schema (LP: #1564607) - * kbuild: always run defconf with -j1 (LP: #1564191) - - [ Leonardo Arias Fonseca ] - * integration tests: use a temporary config path (LP: #1562000) - * Upload snaps passing the snap path. (LP: #1563760) - - [ Vincent Ladeuil ] - * Fix test isolation issues. (LP: 1563965) - - [ Kyle Fazzari ] - * docs/plugins.md: Update for new plugin API. (LP: #1561524) - * Suggest a full clean if step clean is missing state. (LP: #1561328) - * Copy plugin: Add support for sources. (LP: #1559154) - - -- Sergio Schvezov Mon, 04 Apr 2016 23:54:56 -0300 - -snapcraft (2.6.1) xenial; urgency=medium - - [ Kyle Fazzari ] - * Clean: Leave local plugins alone. (LP: #1561546) - - -- Kyle Fazzari Thu, 24 Mar 2016 16:04:13 +0000 - -snapcraft (2.6) xenial; urgency=medium - - [ Leonardo Arias Fonseca ] - * libpipeline example test: update the binary name (LP: #1560254) - * busybox example: update the expected results (LP: #1560255) - - [ Sergio Schvezov ] - * Snaps of type os should not squash with -all-root (LP: #1557513) - * Support architecture all packages when snapping (LP: #1560481) - * Add missing build-packages to the busybox example (LP: #1560586) - * Fixed assets go into a setup dir (LP: 1560969) - * Include and library paths must exist (LP: #1558965) - - [ Kyle Fazzari ] - * Support per-step clean command. (LP: #1537786) - - -- Sergio Schvezov Thu, 24 Mar 2016 01:16:12 -0300 - -snapcraft (2.5) xenial; urgency=medium - - [ Leonardo Arias Fonseca ] - * examples_tests: added more tests after the snaps are installed. - (LP: #1545071) - * travis: run the tests in the GCE trusty machine. (LP: #1555386) - - [ Daniel Holbach ] - * Remove information about PPA. snapcraft and tools will be kept - up-to-date in xenial. (LP: #1554565) - - [ Scott Sweeny ] - * Remove Unicode quotes from help text (LP: #1555733) - - [ Sergio Schvezov ] - * Correct local source pulling (LP: #1558446) - * New plugin: kbuild (LP: #1558623) - * Support downloading snaps (LP: #1558970) - - [ Alexander Sack ] - * New plugin: kernel (LP: #1552168) - - [ Kyle Fazzari ] - * Improve per-step state tracking. (LP: #1558810) - * Migrate old state to new. (LP: #1560158) - - -- Sergio Schvezov Mon, 21 Mar 2016 20:38:18 -0300 - -snapcraft (2.4) xenial; urgency=medium - - [ Kyle Fazzari ] - * Catkin plugin: Print nice message if dependency is invalid. (LP: #1548370) - * Catkin plugin: Handle rosdep empty and multiple dependencies. - (LP: #1548406, #1548404) - * Support --debug flag to enable backtrace and debug logs. (LP: #1548492) - * CMake plugin: Automatically find staged libs and files. (LP: #1550778) - * Copy entire source, even if source-subdir is specified. (LP: #1549676) - * Autotools plugin: Support installing via prefix. (LP: #1544629) - * Support parallel builds (enabled by default). (LP: #1551417) - - [ Sergio Schvezov ] - * Clear error when specifying a non existing command (LP: #1550496) - * Skip the BasePlugin from plugin search (LP: #1547681) - * Expose the invalid build-package on error (LP: #1547672) - * Migrate from skills to interfaces (LP: #1549427) - * Do not print which's output to stdout (LP: #1551939) - * catkin plugin: combine deps as a union of sets (LP: #1552498) - * Support for a daemon's restart-condition. (LP: #1552160) - * Remove the useles decode done in tests. (LP: #1552403) - - [ Leonardo Arias Fonseca ] - * travis: clean up the lxd script (LP: #1550379) - * examples_tests: update the expected result of the libpipeline test - (LP: #1554637, #1554641) - - -- Sergio Schvezov Wed, 09 Mar 2016 17:31:26 +0700 - -snapcraft (2.3.2) xenial; urgency=medium - - * debian/control: lxd should be a suggestion, not a direct dependency. - (LP: #1550381) - - -- Sergio Schvezov Fri, 26 Feb 2016 11:59:46 -0300 - -snapcraft (2.3.1) xenial; urgency=medium - - [ Leonardo Arias Fonseca (ÂĄpaz y baile!) ] - * examples_tests/libpipeline: skip the output assertion when skipping the - install. (LP: #1550108) - - -- Sergio Schvezov Fri, 26 Feb 2016 03:47:11 -0300 - -snapcraft (2.3) xenial; urgency=medium - - [ Leonardo Arias Fonseca ] - * storeapi: reduce the mccabe complexity (LP: #1541011) - * catkin plugin: do not overwrite the PYTHONPATH (LP: #1544790) - * examples_tests: fix the libpipeline test. (LP: #1546771) - * travis: update the command to wait for the network (LP: #1549880) - - [ Daniel Holbach ] - * Generate reference from snapcraft's "help" command. (LP: #1544540) - - [ Kyle Fazzari ] - * Remove roscore plugin. (LP: #1539169) - - [ Sergio Schvezov ] - * New command cleanbuild (using lxd) (LP: #1480144) - * Calling snapcraft with no args defaults to snap (LP: #1548915) - * More attributes for the squashfs'ed snap (LP: #1546821) - * Catch a failure to detach for the log (LP: #1549831) - - -- Sergio Schvezov Thu, 25 Feb 2016 16:00:05 -0300 - -snapcraft (2.2.2) xenial; urgency=medium - - * Set the "after" test's cmake project to use no language (LP: #1544792) - * Disable ros example in adt tests (LP: #1544790) - - -- Sergio Schvezov Fri, 12 Feb 2016 17:04:18 -0300 - -snapcraft (2.2.1) xenial; urgency=medium - - * Add missing build-packages for the opencv example (LP: #1544347) - * Add missing libc6 build dep to integration tests (LP: #1544343) - * Replace dpkg-architecure calls in tests (LP: #1544340) - * Replacing the need for pyversions (LP: #1541451) - - -- Sergio Schvezov Thu, 11 Feb 2016 17:03:57 -0300 - -snapcraft (2.2) xenial; urgency=medium - - [ Leo Arias ] - * Add the unit tests to the autopkgtest suite. (LP: #1541421) - * Use docopt to handle example tests arguments. (LP: #1533395) - * integration-tests: add login and logout tests (LP: #1541391) - * integration_tests: add a successful upload test (LP: #1541391) - * travis: remove the coveralls token (LP: #1543675) - * examples_tests: decode the output with utf-8 (LP: #1543714) - - [ Daniel Holbach ] - * Clear APT::Update::Post-Invoke-Success so we don't run scripts like - update-motd-updates-available. (LP: #1541894) - * Import https://developer.ubuntu.com/snappy/guides/mir-snaps/ - into docs/mir-snaps.md (LP: #1541404) - * Use image link which actually works (raw.githubusercontent.com shows - SVG as raw XML, rawgit.com works as expected). (LP: #1542422) - * Document Snapcraft's wrapper script (steal text from App Dev Manual 15.04) - (LP: #1543581) - * Briefly explain the filesystem layout. (LP: #1543596) - * move image into docs/images (LP: #1542422) - - [ Kyle Fazzari ] - * Improve snapcraft.yaml validation errors. (LP: #1524663) - * Snap: When snapping a directory, look for snap.yaml. (LP: #1541987) - * Upload: Obtain name from YAML instead of snap package. (LP: #1541353) - - [ Sergio Schvezov ] - * Support setting an output file when snapping (LP: #1542479) - * adt fixes for maven and noninteractive deb install (LP: #1542511) - - -- Sergio Schvezov Wed, 10 Feb 2016 14:56:42 -0300 - -snapcraft (2.1.1) xenial; urgency=medium - - [ Kyle Fazzari ] - * Make requests-toolbelt and progressbar a Depends. (LP: #1541349) - - [ Sergio Schvezov ] - * Add gcc as build-packages to integration tests (LP: #1541332) - - -- Sergio Schvezov Wed, 03 Feb 2016 11:00:00 -0300 - -snapcraft (2.1) xenial; urgency=medium - - [ Leo Arias ] - * Run the tests in a xenial LXC. (LP: #1532213) - * Added a mosquitto example. (LP: #1537778) - * Refactored the local source pull. (LP: #1538250) - * Full coverage of meta.py with unit tests. (LP: #1538260) - * Do not report coverage for static and examples tests. (LP: #1538643) - * Add tests errors as details. (LP: #1538354) - * Fix the examples tests using testtools as the base. (LP: #1539196) - * Use the git http protocol in the examples tests. (LP: #1539139) - - [ Daniel Holbach ] - * Make sure that version is set correctly no matter what (version for - 2.0.1 release was '2.0') (LP: #1537580) - * Add document about how to specify app metadata (commands, daemons, - config). (LP: #1535905) - * Add document about debugging snaps. (LP: #1538016) - * Try to capture what the articles are about in a more concise and - clearer way. (LP: #1539502) - * Add more links between the individual articles. (LP: #1539540) - - [ Reto Breitenmoser ] - * tar-content plugin: Add capability to unpack into a specific - destination directory (LP: #1478055) - - [ Kyle Fazzari ] - * Make plugin: Support non-standard makefile name. (LP: #1500759) - * Add documentation for how to use snapcraft upload. (LP: #1539234) - * Upload: Clean up output. (LP: #1538692, #1539814) - - [ Alexander Sack ] - * Fix FD leakage by closing apt cache in repo.py (LP: #1537705) - - [ Ricardo Kirkner ] - * Added support for uploading snap packages directly to the Ubuntu - Store. (LP: #1538657) - * Make sure otp is included in the login request only if it's not - empty (LP: #1539208) - - [ Sergio Schvezov ] - * Support $SNAPCRAFT_STAGE for parts (LP: #1538688) - * debian/control: add python3-responses (LP: #1539199) - * Use the log fixture for logging by default for ut (LP: #1539817) - * Make package installation dynamic to reduce deps (LP: #1539146) - * Remove legacy formatting and implement skills (LP: #1539122) - - -- Sergio Schvezov Tue, 02 Feb 2016 10:24:04 -0300 - -snapcraft (2.0.1) xenial; urgency=medium - - [ Vamshi Balanaga ] - * Added a unit test for pulling bazaar sources from URIs. (LP: #1536283) - - [ Kyle Fazzari ] - * Autotools plugin: Call make before make install (LP: #1536700) - * Add build-package description to docs/snapcraft-sytax.md (LP: #1536659) - * Git source: Make a shallow clone. (LP: #1536696) - * Git source: Support submodules. (LP: #1536698) - - [ Daniel Holbach ] - * Remove 'vendor' from snapcraft init template. Explain that the icon is optional. - (LP: #1536860) - * Add documentation about writing your own plugins. (LP: #1535897) - - -- Sergio Schvezov Sun, 24 Jan 2016 09:22:04 -0800 - -snapcraft (2.0) xenial; urgency=medium - - [ Daniel Holbach ] - * Add document detailing the snapcraft.yaml syntax. - * Add missing periods and fixed typos on the docs. - * Remove vendor for 'master'. - * Add document about parts. - * Add link to config docs. - - [ Sergio Schvezov ] - * Removing the `run` command. - * Update the release for the tomcat example snap. - * Wrapping exe should not remove the path. (LP: #1523912) - * cli: Move to docopt, help cmd migrated. - * cli: list-plugins cmd migrated to docopts. - * cli: clean cmd migrated to docopts. - * cli: init cmd migrated to docopts. - * cli: pull command migrated to docopts. - * clean cmd: migrate to use new lifecycle attribs. - * Removing dead test code. - * cli: build command migrated to docopts. - * cli: stage command migrated to docopts. - * Remove dead code from lifecycle. - * cli: strip command migrated to docopts. - * Obsolete deprecations from 1.x. - * Removing the 'vendor' keyword. (LP: #1510522) - * Making the icon optional. - * cli: snap command migrated to docopts. - * Enabling testing with new cli. - * Fix ordering for conditional negations in catkin tests. - * Replace use of `assert_not_called` in the catkin tests. - * General documentation update. - * Add licensing support. (LP: #1527453) - * snap.yaml implementation with support for readme.md and package.yaml. - (LP: #1532842) - * Documentation refresh. (LP: #1533021) - * Support the new security-override semantics. (LP: #1533293) - * Remove ssh module from snapcraft. (LP: #1533400) - * Fix environment variable handling. (LP: #1531481) - * Wrap apps with the app name. (LP: #1534150) - * Replace SNAP envvars with the 16.04 ones. (LP: #1533552) - * Add bin paths to the to the shebang replace paths in repo (LP: #1534812) - * Initialize CMAKE_PREFIX_PATH to [] for ros (LP: #1535309) - - [ Leo Arias ] - * Added a test to check that the snapcraft files are not copied to the build dir. - * On autopkgtests, run the integration tests, build the examples but do not - install them, do not run the unittests. - * Translated the plainbox tests to python. - * Workaround the failure of the binaries in trusty. - * Updated the runtests script error message. - * Updated the autopkg integration tests. - * Handle the filter parameter for examples tests. (LP: #1533393) - * Split the static and unit tests. (LP: #1533397) - * Added the option to output subunit results in examples tests. (LP: #1533403) - * Updated the tomcat example network capability. (LP: #1533736) - * Added the network-listener capability. (LP: #1534784) - * Add a security-override for chown. - - [ Kyle Fazzari ] - * Catkin plugin: Add support for ROS tools. - * Add contribution guide. - * Resolve FIXME in Catkin plugin. - * Add a tutorial for turning a ROS project into a .snap. - * Catkin plugin: use rosdep for dependency resolution. - * Python{2,3} plugins: Make site-packages link relative. (LP: #1523384) - * Catkin plugin: Refactor build. - * ROS documentation: Fix missing step to make script executable. - * Catkin plugin: Improve cmake path rewrite. - * Add support for mesa libraries. (LP: #1531620) - * Autotools plugin: Set autogen.sh executable. (LP: #1530995) - * Update CONTRIBUTING.md to require a bug. (LP: #1532195) - * Ensure rosdep resolves dependencies using Trusty. (LP: #1532241) - * Catkin plugin: Use in-snap python instead of OS-provided. (LP: #1533297) - * Always migrate files, even if they already exist. (LP: #1534800) - - [ Alexander Sack ] - * Use archive.apache.org URL to ensure we refer to a stable URL that does - not disappear on latest release. - - [ Jonathan Cave ] - * Go plugin creating invalid env. (LP: #1524374) - - [ Renat Galimov ] - * Close not called on the qml plugin. (LP: #1531994) - - [ Vamshi Balanaga ] - * Added test for git sources in sources.py (LP: #1534411) - - -- Leonardo Arias Fonseca Fri, 15 Jan 2016 17:52:01 -0600 - -snapcraft (1.0) xenial; urgency=medium - - [ Sergio Schvezov ] - * Wrapping exe should not be over match to replace (LP: #1523912) - - [ Alexander Sack ] - * Use archive.apache.org URL to ensure we refer to a stable URL that does - not disappear on latest release - - [ Daniel Holbach ] - * Add doc about the syntax of snapcraft.yaml - - [ Kyle Fazzari ] - * Add support for mesa libraries. (LP: #1531620) - * Add a tutorial for turning a ROS project into a .snap. - * Autotools plugin: - - Set autogen.sh executable. (LP: #1530995) - * Catkin plugin: - - Add support for ROS tools (e.g. roslaunch and rosrun). - - Use rosdep for dependency resolution. - - Refactor build. - - Improve cmake path rewrite. - - Ensure rosdep resolves dependencies using Trusty. (LP: #1532241) - * Python2 plugin: - - Make site-packages link relative. (LP: #1523384) - * Python3 plugin: - - Make site-packages link relative. (LP: #1523384) - - [ Renat Galimov ] - * Close not called on the qml plugin (LP: #1531994) - - -- Kyle Fazzari Thu, 7 Jan 2016 09:09:21 -0400 - -snapcraft (0.6) xenial; urgency=medium - - [ Leo Arias ] - * Start a suite for examples tests. - - [ Sergio Schvezov ] - * nodejs plugin: support 32 bit node - * go plugin: remove hardcoded arch triplet from test - * Don't filter out easy install's .pth and wrap config (LP: #1519724) - * Remove the `parts` arg from `init` (LP: #1516775) - * Support architectures override (LP: #1520248) - * Detect encoding of snapcraft.yaml before parsing (LP: #1518150) - - [ Daniel Holbach ] - * Document how to insall and setup snapcraft. - * Update documentation to include node.js example - * Document filesets and excludes - * Make the webcam example click-review happy. - * Initialize shebang variable when wrapping execs (LP: #1519702) - - -- Sergio Schvezov Mon, 30 Nov 2015 16:31:47 -0300 - -snapcraft (0.5) xenial; urgency=medium - - [ Sujeevan Vijayakumaran ] - * Added 'git@' to the automatic identification of the source. - * Updated HACKING: replaced Launchpad with GitHub. - - [ Bjorn Tillenius ] - * Rewrite the shebang and execute it in the wrapper script. - (Fixes LP: #1507357 and LP: #1516404) - - [ Leo Arias ] - * Replaced the usage of % with .format. (LP: #1477638) - * Fixed the id of the circle tests. - * Replaced the double quotes by single quotes on strings. (LP: #1476467) - * Added the instructions to run the tests in travis. - * Split the suite in two: unit and plainbox. - - [ Sergio Schvezov ] - * Don't wrap the vcs commands in the env. - * Making source management common to all types. - * Updating setup.py's metadata. - * Do not install recommends for build or stage pkgs. (LP: #1500375) - * Silence the init unit test and verify stdout. - * Making the examples individual tests. - * Inherit directly from the BasePlugin for autotools. - * Clean for parts and remove dup from lifecycle and plugin. - * Validate that 'plugins' is not used as a part name. - * Support the source-subdir keyword for parts. - * Adding a ticker to `snappy build`. (LP: #1502410) - * Exiting with error when a plugin cannot be loaded. - * catkin plugin: Get deps from the part's sourcedir, fail if needed. - * go plugin: - - Use CGO_LDFLAGS when building. (LP: #1513935) - - Support local sources. (LP: #1515132, LP: #1516228 and LP: #1499240) - - Implement a go-packages plugin property - * nodejs plugin: - - Initial implementation. (LP: #1518403) - - Support node-packages. - * copy plugin: Support globs. (LP: #1478054) - * catkin plugin: - - Typo s/packages.xml/package.xml/ - - Catch the correct exception for missing catkin pkg - - [ Ted Gould ] - * Adding a simple tree test to look at the dependency resolution - * Add schema for the core properties of the system that are independent of a part - * copy-plugin: test for directories. (LP: #1478052) - * python plugins: - - Support pip-packages. (LP: #1502132) - - fix conflicts with pyc files. (LP: #1502105) - - [ Paul Larson ] - * Don't throw exception on snapcraft run exit status. (LP: #1499242) - * Minor fixes to setup.py - - [ Jonathan Cave ] - * Add nil plugin. (LP: #1518404) - - -- Sergio Schvezov Tue, 24 Nov 2015 13:29:19 -0300 - -snapcraft (0.4) xenial; urgency=medium - - * Core: - - Install build packages if package is removed but not purged - (LP: #1507814) - - Don't crash on help for unexisting plugin (LP: #1510954) - - Don't follow links when checking for suid/guid for unpacked - debian package contents (LP: #1511161) - - Raise exceptions for plugin errors (LP: #1481122) - - Exit cleanly with an error when using the source keyword with a local - file (LP: #1499424) - - Add version flags to cli (LP: #1501222) - - Search the wiki for a part if the 'plugin' keyword is missing - (LP: #1506205) - - Developer documentation for the plugin base class added (LP: #1507075) - - Add subcommand to list plugins (LP: #1510160) - - Add subcommand for help (LP: #1510683) - * Plugins: - - autotools: use autoreconf if needed (LP: #1507648) - - maven: support maven flags (LP: #1502031) - - catkin: new plugin for building ros projects (LP: #1506201) - * Packaging: - - Run tests on package build (LP: #1506096) - - debian/control: python3-fixtures and python3-testscenarios build deps - (LP: #1507573) - - -- Sergio Schvezov Thu, 29 Oct 2015 12:52:04 -0300 - -snapcraft (0.3) wily; urgency=medium - - * Core imprevements: - - Add deprecation messages for deprecated keywords (LP: #1501494) - - Remove suid/guid from staged packages (LP: #1503495) - - Autodetect tar sources (LP: #1500726) - - Better logging if output is not a tty (LP: #1500887) - - Improved error message when a plugin is not found (LP: #1501980) - * Plugin improvements: - - Types instead of plugin as a keyword (LP: #1500857) - - Plugin names no longer have '-project' as a suffix (LP: #1501496) - - Local plugins can override built-in ones with x-[plugin].py - (LP: #1500873) - * New plugins: - - Scons support added (LP: #1500758) - * Bug fixes: - - Multi python3 install support (LP: #1499429) - - Use the system series for stage-packages (LP: #1501035) - - Handle framework policies (LP: #1501037). - - Don't infer a plugin name from a part name (LP: #1501413) - - Installation errors during build-package's setup now errors - (LP: #1502449) - - When a dangling symlink is found, try and satisfy it with a - package on the host (LP: #1500505) - - Support reextraction when using tar sources (LP: #1500728) - - Do not require geoip (LP: #1499158) - * Examples: - - Fix build requirements issue with python2 project (LP: #1501997) - - Add missing plugin keyword for the python2 example (LP: #1501977) - - Updated the upstream tarball for tomcat (LP: #1504174) - - -- Sergio Schvezov Fri, 25 Sep 2015 12:46:23 +0200 - -snapcraft (0.2.1) wily; urgency=medium - - * New upstream release (LP: #1499265) - * Brown-paper bag release: - - Fix install path of examples. Thanks Martin Pitt for noticing. - - Allow using local sources through an env var (mostly useful for - Launchpad building). - - -- Daniel Holbach Thu, 24 Sep 2015 11:37:36 +0200 - -snapcraft (0.2) wily; urgency=medium - - * Better setuptools support: - - Better support python-setuptools (LP: #1481864), - - Used builddir as a base for setup.py overrides (LP: #1498212), - - Fix build (LP: #1494825), - * Plugin fixes: - - Add demo.qml back to the snapcraft.yaml for the QML Demo (LP: #1491301), - - stage package libgudev-1.0-0, which makes the godd snap actually - work (LP: #1498347), - - Wrap setup.py calls to configure the shebang writer (LP: #1486680), - - Update tomcat upstream URL, fixes example again (LP: #1491303), - - Add libgudev-1.0-dev as build-tools for godd example, - Ensure C library configuration tools don't use system - paths (LP: #1496789), - * Snapcraft cli: - - On clean, check the contents of the parts dir only if it - exists. (LP: #1497371) - - Load the config before trying to run (LP: #1498140), - - Notify user why the password is being requested (LP: #1481499), - - Fix numerous issues in snapcraft run (LP: #1486659), - * Snapcraft stage-packages: - - Enable ports for architectures that are not amd64 or - i386 (LP: #1498157), - - Improving stage-package handling (LP: #1497453, LP: #1497582) - - Fetch all packages in a single download run with proper - progress (LP: #1498333), - * Snapcraft wiki queries excessive (LP: #1496381), - * Snapcraft internals: - - Add 'simple' and 'has-leftovers' flags to all integration tests job - units. (LP: #1484596), - - Regex for binary and service names (LP: #1495662), - - Provide a nice error when tabs found in snapcraft.yaml (LP: #1477875), - - Use relative paths for image creation (LP: #1497108), - - Use the python logger (LP: #1476452), - - snapcraft now has less exit points (LP: #1477639), - - Depend and Build-Depend on python3-requests (LP: #1496363), - - Add autopkgtest, reshuffle build-deps accordingly (LP: #1496392), - - Fix "snapcraft run" (LP: #1484720), - * Examples packaged (LP: #1498189). - - -- Sergio Schvezov Wed, 24 Sep 2015 14:23:24 -0300 - -snapcraft (0.1) wily; urgency=low - - * Initial release - - -- Michael Terry Mon, 6 Jul 2015 21:55:21 -0500 diff --git a/debian/compat b/debian/compat deleted file mode 100644 index ec635144f6..0000000000 --- a/debian/compat +++ /dev/null @@ -1 +0,0 @@ -9 diff --git a/debian/control b/debian/control deleted file mode 100644 index 57cc3394df..0000000000 --- a/debian/control +++ /dev/null @@ -1,19 +0,0 @@ -Source: snapcraft -Section: utils -Priority: extra -Maintainer: Snapcraft Team -Build-Depends: debhelper -Homepage: https://github.com/canonical/snapcraft -Vcs-Git: https://github.com/canonical/snapcraft.git -Vcs-Browser: https://github.com/canonical/snapcraft -Standards-Version: 4.1.3 - -Package: snapcraft -Architecture: all -Depends: ${misc:Depends} -Suggests: lxd, snapd (>= 2.15~) -Description: easily craft snaps - Snapcraft aims to make upstream developers' lives easier and as such is not - a single toolset, but instead is a collection of tools that enable the - natural workflow of an upstream to be extended with a simple release step - into Snappy. diff --git a/debian/copyright b/debian/copyright deleted file mode 100644 index e47c2839d4..0000000000 --- a/debian/copyright +++ /dev/null @@ -1,50 +0,0 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: Snapcraft -Upstream-Contact: Snapcraft Team -Source: https://github.com/canonical/snapcraft - -Files: * -Copyright: 2015-2017 Canonical Ltd -License: GPL-3 - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License version 3 as - published by the Free Software Foundation. - . - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - . - You should have received a copy of the GNU General Public License - along with this program. If not, see . - . - On Debian systems, the full text of the GNU General Public License - version 3 can be found in the file /usr/share/common-licenses/GPL-3. - -Files: snapcraft/demos/qt4-text-editor/* snapcraft/demos/qt5-text-editor/* -Copyright: 2015 The Qt Company Ltd. -License: BSD-3-clause - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - . - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - . - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - . - 3. Neither the name of the copyright holder nor the names of its contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. - . - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/debian/rules b/debian/rules deleted file mode 100755 index c7d2f48664..0000000000 --- a/debian/rules +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/make -f -# -*- Mode:Makefile; indent-tabs-mode:t; tab-width:4 -*- - -%: - dh $@ - -override_dh_auto_clean: - @echo - -override_dh_auto_build: - @echo - -override_dh_auto_install: - @echo diff --git a/debian/source/format b/debian/source/format deleted file mode 100644 index 89ae9db8f8..0000000000 --- a/debian/source/format +++ /dev/null @@ -1 +0,0 @@ -3.0 (native) diff --git a/debian/source/options b/debian/source/options deleted file mode 100644 index eefd6f1b18..0000000000 --- a/debian/source/options +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore standard files (like .bzr) -tar-ignore diff --git a/debian/tests/control b/debian/tests/control deleted file mode 100644 index 472faaf334..0000000000 --- a/debian/tests/control +++ /dev/null @@ -1,9 +0,0 @@ -Tests: integrationtests-spread -Restrictions: needs-root, allow-stderr, isolation-machine, rw-build-tree -Depends: @, - fuse, - gcc, - git, - libc6-dev, - openssh-server, - snapd (>= 2.15~), diff --git a/debian/tests/get-release-codename b/debian/tests/get-release-codename deleted file mode 100755 index b15bea1d6a..0000000000 --- a/debian/tests/get-release-codename +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# shellcheck disable=SC1091 -. /etc/os-release - -echo "$VERSION_CODENAME" diff --git a/debian/tests/integrationtests-spread b/debian/tests/integrationtests-spread deleted file mode 100755 index 11db5823cb..0000000000 --- a/debian/tests/integrationtests-spread +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/sh - -set -ex - -# required for the debian adt host -mkdir -p /etc/systemd/system/snapd.service.d/ -if [ "${http_proxy:-}" != "" ]; then - cat <<-EOF | tee /etc/systemd/system/snapd.service.d/proxy.conf - [Service] - Environment=http_proxy=$http_proxy - Environment=https_proxy=$http_proxy - EOF - - # ensure environment is updated - echo "http_proxy=$http_proxy" >> /etc/environment - echo "https_proxy=$http_proxy" >> /etc/environment -fi -systemctl daemon-reload - -# ensure we are not killed too easily -printf '%s\n' "-950" > /proc/$$/oom_score_adj || true - -# see what mem we have (for debugging) -cat /proc/meminfo - -# ensure we can do a connect to localhost -echo ubuntu:ubuntu | chpasswd -sed -i 's/\(PermitRootLogin\|PasswordAuthentication\)\>.*/\1 yes/' /etc/ssh/sshd_config -systemctl reload sshd.service - -# Spread will only build with recent go -snap install --classic go - -# Remove the snapcraft deb -sudo apt-get autoremove --purge --yes snapcraft - -export GOPATH=/tmp/go -/snap/bin/go get -u github.com/snapcore/spread/cmd/spread - -# Remove go now that spread is built -snap remove go - -# and now run spread against localhost -# shellcheck disable=SC1091 -. /etc/os-release -export SNAPCRAFT_PACKAGE_TYPE="snap" -export SNAPCRAFT_CHANNEL="latest/edge" -/tmp/go/bin/spread -v "autopkgtest:${ID}-${VERSION_ID}-$(dpkg --print-architecture)" - -# store journal info for inspection -journalctl --sync -journalctl -ab > "$ADT_ARTIFACTS/journal.txt" diff --git a/docker/Dockerfile b/docker/Dockerfile deleted file mode 100644 index bffb2192c4..0000000000 --- a/docker/Dockerfile +++ /dev/null @@ -1,74 +0,0 @@ -ARG RISK=edge -ARG UBUNTU=xenial - -FROM ubuntu:$UBUNTU as builder -ARG RISK -ARG UBUNTU -RUN echo "Building snapcraft:$RISK in ubuntu:$UBUNTU" - -# Grab dependencies -RUN apt-get update -RUN apt-get dist-upgrade --yes -RUN apt-get install --yes \ - curl \ - jq \ - squashfs-tools - -# Grab the core snap (for backwards compatibility) from the stable channel and -# unpack it in the proper place. -RUN curl -L $(curl -H 'X-Ubuntu-Series: 16' 'https://api.snapcraft.io/api/v1/snaps/details/core' | jq '.download_url' -r) --output core.snap -RUN mkdir -p /snap/core -RUN unsquashfs -d /snap/core/current core.snap - -# Grab the core18 snap (which snapcraft uses as a base) from the stable channel -# and unpack it in the proper place. -RUN curl -L $(curl -H 'X-Ubuntu-Series: 16' 'https://api.snapcraft.io/api/v1/snaps/details/core18' | jq '.download_url' -r) --output core18.snap -RUN mkdir -p /snap/core18 -RUN unsquashfs -d /snap/core18/current core18.snap - -# Grab the core20 snap (which snapcraft uses as a base) from the stable channel -# and unpack it in the proper place. -RUN curl -L $(curl -H 'X-Ubuntu-Series: 16' 'https://api.snapcraft.io/api/v1/snaps/details/core20' | jq '.download_url' -r) --output core20.snap -RUN mkdir -p /snap/core20 -RUN unsquashfs -d /snap/core20/current core20.snap - -# Grab the snapcraft snap from the $RISK channel and unpack it in the proper -# place. -RUN curl -L $(curl -H 'X-Ubuntu-Series: 16' 'https://api.snapcraft.io/api/v1/snaps/details/snapcraft?channel='$RISK | jq '.download_url' -r) --output snapcraft.snap -RUN mkdir -p /snap/snapcraft -RUN unsquashfs -d /snap/snapcraft/current snapcraft.snap - -# Fix Python3 installation: Make sure we use the interpreter from -# the snapcraft snap: -RUN unlink /snap/snapcraft/current/usr/bin/python3 -RUN ln -s /snap/snapcraft/current/usr/bin/python3.* /snap/snapcraft/current/usr/bin/python3 -RUN echo /snap/snapcraft/current/lib/python3.*/site-packages >> /snap/snapcraft/current/usr/lib/python3/dist-packages/site-packages.pth - -# Create a snapcraft runner (TODO: move version detection to the core of -# snapcraft). -RUN mkdir -p /snap/bin -RUN echo "#!/bin/sh" > /snap/bin/snapcraft -RUN snap_version="$(awk '/^version:/{print $2}' /snap/snapcraft/current/meta/snap.yaml | tr -d \')" && echo "export SNAP_VERSION=\"$snap_version\"" >> /snap/bin/snapcraft -RUN echo 'exec "$SNAP/usr/bin/python3" "$SNAP/bin/snapcraft" "$@"' >> /snap/bin/snapcraft -RUN chmod +x /snap/bin/snapcraft - -# Multi-stage build, only need the snaps from the builder. Copy them one at a -# time so they can be cached. -FROM ubuntu:$UBUNTU -COPY --from=builder /snap/core /snap/core -COPY --from=builder /snap/core18 /snap/core18 -COPY --from=builder /snap/core20 /snap/core20 -COPY --from=builder /snap/snapcraft /snap/snapcraft -COPY --from=builder /snap/bin/snapcraft /snap/bin/snapcraft - -# Generate locale and install dependencies. -RUN apt-get update && apt-get dist-upgrade --yes && apt-get install --yes snapd sudo locales && locale-gen en_US.UTF-8 - -# Set the proper environment. -ENV LANG="en_US.UTF-8" -ENV LANGUAGE="en_US:en" -ENV LC_ALL="en_US.UTF-8" -ENV PATH="/snap/bin:/snap/snapcraft/current/usr/bin:$PATH" -ENV SNAP="/snap/snapcraft/current" -ENV SNAP_NAME="snapcraft" -ENV SNAP_ARCH="amd64" diff --git a/docker/README.md b/docker/README.md index 528fb9acfb..4615244cbb 100644 --- a/docker/README.md +++ b/docker/README.md @@ -1,16 +1,26 @@ -# Creating docker containers for snapcraft +# Docker images for `snapcraft` -By default the `Dockerfile` builds Ubuntu 16.04 (Xenial) image with `snapcraft` from the `edge` channel. +OCI-compliant container images and their sources are officially supported by the +https://github.com/canonical/snapcraft-rocks/ project. - docker build . --no-cache +To build a snap with the docker container, you need to choose an image that +matches snap `base`. For example, to build `base: core24` snap: -It is however possible to choose the base Ubuntu version and the Snapcraft channel (risk levels): + docker run -it -v `pwd`:/project ghcr.io/canonical/snapcraft:8_core24 -- `edge` -- `beta` -- `candidate` -- `stable` + * `8` in `8_core24` is the version of snapcraft. + * `\; -v` construction at the end is required to see `snapcraft` output. -To do that, use `--build-arg RISK=` and `--build-arg UBUNTU=` arguments: +For more details, see official `snapcraft-rocks` repo from Canonical. - docker build . --no-cache --build-arg RISK=beta --build-arg UBUNTU=bionic +### Building snaps with `podman` + +`podman` was born as a rootless alternative to Docker. It is default on Fedora +to have `podman` instead of Docker, but SELinux there doesn't allow containers +to write to volumes, so we just turn this "feature" off with + `--security-opt label=disable`. + +```sh +podman run -it --rm --security-opt label=disable \ + -v `pwd`:/project ghcr.io/canonical/snapcraft:8_core24 \; -v +``` diff --git a/docs/.sphinx/pinned-requirements.txt b/docs/.sphinx/pinned-requirements.txt index 9a3bb3b63e..fe9e0eccd4 100644 --- a/docs/.sphinx/pinned-requirements.txt +++ b/docs/.sphinx/pinned-requirements.txt @@ -1,6 +1,6 @@ alabaster==0.7.16 Babel==2.11.0 -beautifulsoup4==4.11.1 +beautifulsoup4==4.12.3 certifi==2024.7.4 charset-normalizer==2.1.1 colorama==0.4.6 @@ -16,7 +16,7 @@ pyenchant==3.2.2 Pygments==2.15.0 pyparsing==3.0.9 pytz==2022.6 -requests==2.31.0 +requests==2.32.2 six==1.16.0 snowballstemmer==2.2.0 soupsieve==2.3.2.post1 diff --git a/docs/reference/changelog.rst b/docs/reference/changelog.rst index fbc344f8ac..c4f94847ba 100644 --- a/docs/reference/changelog.rst +++ b/docs/reference/changelog.rst @@ -1,3 +1,5 @@ +:tocdepth: 2 + Changelog ********* @@ -68,6 +70,58 @@ Changelog For a complete list of commits, check out the `X.Y.Z`_ release on GitHub. + +8.4.2 (2024-Oct-07) +------------------- + +Core +==== + +* Fix a regression where Snapcraft would fail to run on some architectures due + to a ``cryptography`` dependency that attempted to load legacy algorithms + (`#5077`_). + +* Fix a regression where Snapcraft would fail to run in a container if it was + not running as a snap (`#5079`_). + +* Fix a bug where parallel installations of Snapcraft would not work if the + Snapcraft snap was installed from the store (`#4683`_, `#4927`_). + +Plugins +####### + +Python +"""""" + +* Fix an issue where the ``python`` plugin would fail to build if the part + had no Python scripts. + +Remote build +============ + +* Fix a bug where the remote builder would ignore the user's response when a + build is interrupted and always clean the launchpad project (`#4929`_). + +Documentation +============= + +* Update Rust plugin doc with recent changes to the Rust toolchain. + +For a complete list of commits, check out the `8.4.2`_ release on GitHub. + + +7.5.7 (2024-Oct-03) +------------------- + +Core +==== + +* Fix a bug where parallel installations of Snapcraft would not work if the + Snapcraft snap was installed from the store (`#4683`_, `#4927`_). + +For a complete list of commits, check out the `7.5.7`_ release on GitHub. + + 8.4.1 (2024-Sep-20) ------------------- @@ -1187,6 +1241,7 @@ For a complete list of commits, check out the `8.0.0`_ release on GitHub. .. _#4517: https://github.com/canonical/snapcraft/issues/4517 .. _#4520: https://github.com/canonical/snapcraft/issues/4520 .. _#4547: https://github.com/canonical/snapcraft/issues/4547 +.. _#4683: https://github.com/canonical/snapcraft/issues/4683 .. _#4685: https://github.com/canonical/snapcraft/issues/4685 .. _#4735: https://github.com/canonical/snapcraft/issues/4735 .. _#4744: https://github.com/canonical/snapcraft/issues/4744 @@ -1219,6 +1274,8 @@ For a complete list of commits, check out the `8.0.0`_ release on GitHub. .. _#4890: https://github.com/canonical/snapcraft/issues/4890 .. _#4908: https://github.com/canonical/snapcraft/issues/4908 .. _#4909: https://github.com/canonical/snapcraft/issues/4909 +.. _#4927: https://github.com/canonical/snapcraft/issues/4927 +.. _#4929: https://github.com/canonical/snapcraft/issues/4929 .. _#4930: https://github.com/canonical/snapcraft/issues/4930 .. _#4941: https://github.com/canonical/snapcraft/issues/4941 .. _#4942: https://github.com/canonical/snapcraft/issues/4942 @@ -1228,8 +1285,11 @@ For a complete list of commits, check out the `8.0.0`_ release on GitHub. .. _#4995: https://github.com/canonical/snapcraft/issues/4995 .. _#5008: https://github.com/canonical/snapcraft/issues/5008 .. _#5048: https://github.com/canonical/snapcraft/issues/5048 +.. _#5077: https://github.com/canonical/snapcraft/issues/5077 +.. _#5079: https://github.com/canonical/snapcraft/issues/5079 .. _7.5.6: https://github.com/canonical/snapcraft/releases/tag/7.5.6 +.. _7.5.7: https://github.com/canonical/snapcraft/releases/tag/7.5.7 .. _8.0.0: https://github.com/canonical/snapcraft/releases/tag/8.0.0 .. _8.0.1: https://github.com/canonical/snapcraft/releases/tag/8.0.1 .. _8.0.2: https://github.com/canonical/snapcraft/releases/tag/8.0.2 @@ -1257,3 +1317,4 @@ For a complete list of commits, check out the `8.0.0`_ release on GitHub. .. _8.3.4: https://github.com/canonical/snapcraft/releases/tag/8.3.4 .. _8.4.0: https://github.com/canonical/snapcraft/releases/tag/8.4.0 .. _8.4.1: https://github.com/canonical/snapcraft/releases/tag/8.4.1 +.. _8.4.2: https://github.com/canonical/snapcraft/releases/tag/8.4.2 diff --git a/docs/reference/plugins.rst b/docs/reference/plugins.rst index d00ecde67c..9b9e76368f 100644 --- a/docs/reference/plugins.rst +++ b/docs/reference/plugins.rst @@ -21,6 +21,7 @@ Snapcraft. /common/craft-parts/reference/plugins/meson_plugin /common/craft-parts/reference/plugins/nil_plugin /common/craft-parts/reference/plugins/npm_plugin + plugins/poetry_plugin plugins/python_plugin /common/craft-parts/reference/plugins/qmake_plugin /common/craft-parts/reference/plugins/rust_plugin diff --git a/docs/reference/plugins/_python_common.rst b/docs/reference/plugins/_python_common.rst new file mode 100644 index 0000000000..f894647c10 --- /dev/null +++ b/docs/reference/plugins/_python_common.rst @@ -0,0 +1,17 @@ + +Dependencies +------------ + +Whether the Python interpreter needs to be included in the snap depends on its +``confinement``. Specifically: + +- Projects with ``strict`` or ``devmode`` confinement can safely use the base + snap's interpreter, so they typically do **not** need to include Python. +- Projects with ``classic`` confinement **cannot** use the base snap's + interpreter and thus must always bundle it (typically via ``stage-packages``). +- In both cases, a specific/custom Python installation can always be included + in the snap. This can be useful, for example, when using a different Python + version or building an interpreter with custom flags. + +Snapcraft will prefer an included interpreter over the base's, even for projects +with ``strict`` and ``devmode`` confinement. diff --git a/docs/reference/plugins/poetry_plugin.rst b/docs/reference/plugins/poetry_plugin.rst new file mode 100644 index 0000000000..0823c4e9ba --- /dev/null +++ b/docs/reference/plugins/poetry_plugin.rst @@ -0,0 +1,7 @@ +.. include:: /common/craft-parts/reference/plugins/poetry_plugin.rst + :end-before: .. _poetry-details-begin: + +.. include:: _python_common.rst + +.. include:: /common/craft-parts/reference/plugins/poetry_plugin.rst + :start-after: .. _poetry-details-end: diff --git a/docs/reference/plugins/python_plugin.rst b/docs/reference/plugins/python_plugin.rst index f0cf5e76b5..eeeb5ce1ac 100644 --- a/docs/reference/plugins/python_plugin.rst +++ b/docs/reference/plugins/python_plugin.rst @@ -2,22 +2,7 @@ .. include:: /common/craft-parts/reference/plugins/python_plugin.rst :end-before: .. _python-details-begin: -Dependencies ------------- - -Whether the Python interpreter needs to be included in the snap depends on its -``confinement``. Specifically: - -- Projects with ``strict`` or ``devmode`` confinement can safely use the base - snap's interpreter, so they typically do **not** need to include Python. -- Projects with ``classic`` confinement **cannot** use the base snap's - interpreter and thus must always bundle it (typically via ``stage-packages``). -- In both cases, a specific/custom Python installation can always be included - in the snap. This can be useful, for example, when using a different Python - version or building an interpreter with custom flags. - -Snapcraft will prefer an included interpreter over the base's, even for projects -with ``strict`` and ``devmode`` confinement. +.. include:: _python_common.rst .. include:: /common/craft-parts/reference/plugins/python_plugin.rst :start-after: .. _python-details-end: diff --git a/osv-scanner.toml b/osv-scanner.toml new file mode 100644 index 0000000000..17da2fac14 --- /dev/null +++ b/osv-scanner.toml @@ -0,0 +1,4 @@ +[[IgnoredVulns]] +id = "CVE-2024-35195" +ignoreUntil = "2025-01-01T00:00:00Z" +reason = "Needed for requests-unixsocket, which we're replacing with requests-unixsocket2" diff --git a/requirements-devel.txt b/requirements-devel.txt index 2660b4f900..951ca5ebbc 100644 --- a/requirements-devel.txt +++ b/requirements-devel.txt @@ -8,7 +8,7 @@ attrs==24.2.0 autodocsumm==0.2.13 babel==2.16.0 beautifulsoup4==4.12.3 -black==24.8.0 +black==24.10.0 boolean.py==4.0 bracex==2.5 CacheControl==0.14.0 @@ -24,14 +24,14 @@ click==8.1.7 codespell==2.3.0 colorama==0.4.6 coverage==7.6.1 -craft-application==4.2.4 +craft-application==4.2.6 craft-archives==2.0.0 craft-cli==2.7.0 craft-grammar==2.0.1 -craft-parts==2.1.1 +craft-parts==2.1.2 craft-platforms==0.1.1 -craft-providers==2.0.1 -craft-store==3.0.1 +craft-providers==2.0.4 +craft-store==3.0.2 cryptography==43.0.1 cssutils==2.11.1 dict2css==0.3.0.post1 @@ -108,7 +108,7 @@ pyftpdlib==1.5.10 pygit2==1.13.3 Pygments==2.18.0 pylint==3.2.7 -pylxd==2.3.4 +pylxd==2.3.5 pymacaroons==0.13.0 PyNaCl==1.5.0 pyparsing==3.1.4 @@ -128,9 +128,9 @@ pyxdg==0.28 PyYAML==6.0.2 raven==6.10.0 regex==2024.7.24 -requests==2.31.0 +requests==2.32.3 requests-toolbelt==1.0.0 -requests-unixsocket==0.3.0 +requests-unixsocket2==0.4.2 ruamel.yaml==0.18.6 ruamel.yaml.clib==0.2.8 SecretStorage==3.3.3 @@ -164,7 +164,7 @@ sphinxcontrib-jsmath==1.0.1 sphinxcontrib-qthelp==2.0.0 sphinxcontrib-serializinghtml==2.0.0 sphinxext-opengraph==0.9.1 -starlette==0.38.5 +starlette==0.40.0 tabulate==0.9.0 testscenarios==0.5.0 testtools==2.7.2 @@ -182,7 +182,7 @@ types-toml==0.10.8.20240310 types-urllib3==1.26.25.14 typing_extensions==4.12.2 uc-micro-py==1.0.3 -urllib3==1.26.20 +urllib3==2.2.3 uvicorn==0.30.6 validators==0.33.0 venusian==3.1.0 @@ -199,5 +199,5 @@ yamllint==1.35.1 zipp==3.20.2 zope.deprecation==5.0 zope.interface==7.0.3 -python-apt @ https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/python-apt/2.4.0ubuntu1/python-apt_2.4.0ubuntu1.tar.xz; sys.platform == "linux" +python-apt @ https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/python-apt/2.4.0ubuntu1/python-apt_2.4.0ubuntu1.tar.xz ; sys.platform == "linux" pyinstaller==5.13.2; sys.platform == "win32" diff --git a/requirements-docs.txt b/requirements-docs.txt index 787942bceb..a91631c168 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -19,14 +19,14 @@ chardet==5.2.0 charset-normalizer==3.3.2 click==8.1.7 colorama==0.4.6 -craft-application==4.2.4 +craft-application==4.2.6 craft-archives==2.0.0 craft-cli==2.7.0 craft-grammar==2.0.1 -craft-parts==2.1.1 +craft-parts==2.1.2 craft-platforms==0.1.1 -craft-providers==2.0.1 -craft-store==3.0.1 +craft-providers==2.0.4 +craft-store==3.0.2 cryptography==43.0.1 cssutils==2.11.1 dict2css==0.3.0.post1 @@ -81,7 +81,7 @@ pydantic_yaml==1.3.0 pyelftools==0.31 pygit2==1.13.3 Pygments==2.18.0 -pylxd==2.3.4 +pylxd==2.3.5 pymacaroons==0.13.0 PyNaCl==1.5.0 pyparsing==3.1.4 @@ -94,9 +94,9 @@ pyxdg==0.28 PyYAML==6.0.2 raven==6.10.0 regex==2024.7.24 -requests==2.31.0 +requests==2.32.3 requests-toolbelt==1.0.0 -requests-unixsocket==0.3.0 +requests-unixsocket2==0.4.2 ruamel.yaml==0.18.6 ruamel.yaml.clib==0.2.8 SecretStorage==3.3.3 @@ -130,13 +130,13 @@ sphinxcontrib-jsmath==1.0.1 sphinxcontrib-qthelp==2.0.0 sphinxcontrib-serializinghtml==2.0.0 sphinxext-opengraph==0.9.1 -starlette==0.38.5 +starlette==0.40.0 tabulate==0.9.0 tinydb==4.8.0 toml==0.10.2 typing_extensions==4.12.2 uc-micro-py==1.0.3 -urllib3==1.26.20 +urllib3==2.2.3 uvicorn==0.30.6 validators==0.33.0 wadllib==1.3.6 @@ -147,4 +147,4 @@ websockets==12.0 wheel==0.44.0 ws4py==0.5.1 zipp==3.20.2 -python-apt @ https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/python-apt/2.4.0ubuntu1/python-apt_2.4.0ubuntu1.tar.xz; sys.platform == "linux" +python-apt @ https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/python-apt/2.4.0ubuntu1/python-apt_2.4.0ubuntu1.tar.xz ; sys.platform == "linux" diff --git a/requirements.txt b/requirements.txt index 638d3ddb58..0094f8ba12 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,14 +7,14 @@ cffi==1.17.1 chardet==5.2.0 charset-normalizer==3.3.2 click==8.1.7 -craft-application==4.2.4 +craft-application==4.2.6 craft-archives==2.0.0 craft-cli==2.7.0 craft-grammar==2.0.1 -craft-parts==2.1.1 +craft-parts==2.1.2 craft-platforms==0.1.1 -craft-providers==2.0.1 -craft-store==3.0.1 +craft-providers==2.0.4 +craft-store==3.0.2 cryptography==43.0.1 distro==1.9.0 docutils==0.19 @@ -47,7 +47,7 @@ pydantic_core==2.20.1 pydantic_yaml==1.3.0 pyelftools==0.31 pygit2==1.13.3 -pylxd==2.3.4 +pylxd==2.3.5 pymacaroons==0.13.0 PyNaCl==1.5.0 pyparsing==3.1.4 @@ -58,9 +58,9 @@ pytz==2024.1 pyxdg==0.28 PyYAML==6.0.2 raven==6.10.0 -requests==2.31.0 +requests==2.32.3 requests-toolbelt==1.0.0 -requests-unixsocket==0.3.0 +requests-unixsocket2==0.4.2 ruamel.yaml==0.18.6 ruamel.yaml.clib==0.2.8 SecretStorage==3.3.3 @@ -72,10 +72,10 @@ tabulate==0.9.0 tinydb==4.8.0 toml==0.10.2 typing_extensions==4.12.2 -urllib3==1.26.20 +urllib3==2.2.3 validators==0.33.0 wadllib==1.3.6 wheel==0.44.0 ws4py==0.5.1 zipp==3.20.2 -python-apt @ https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/python-apt/2.4.0ubuntu1/python-apt_2.4.0ubuntu1.tar.xz; sys.platform == "linux" +python-apt @ https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/python-apt/2.4.0ubuntu1/python-apt_2.4.0ubuntu1.tar.xz ; sys.platform == "linux" diff --git a/setup.py b/setup.py index 5fdd2365ab..545c7b11b9 100755 --- a/setup.py +++ b/setup.py @@ -98,14 +98,14 @@ def recursive_data_files(directory, install_directory): "attrs", "catkin-pkg; sys_platform == 'linux'", "click", - "craft-application>=4.2.4,<5.0.0", + "craft-application>=4.2.6,<5.0.0", "craft-archives~=2.0", "craft-cli~=2.6", "craft-grammar>=2.0.1,<3.0.0", - "craft-parts~=2.1", + "craft-parts>=2.1.2,<3.0.0", "craft-platforms~=0.1", - "craft-providers~=2.0", - "craft-store>=3.0.1,<4.0.0", + "craft-providers>=2.0.4,<3.0.0", + "craft-store>=3.0.2,<4.0.0", "docutils<0.20", # Frozen until we can update sphinx dependencies. "gnupg", "jsonschema==2.5.1", @@ -130,7 +130,7 @@ def recursive_data_files(directory, install_directory): "pyyaml", "raven", "requests-toolbelt", - "requests-unixsocket", + "requests-unixsocket2", "requests", "simplejson", "snap-helpers", @@ -138,7 +138,6 @@ def recursive_data_files(directory, install_directory): "toml", "tinydb", "typing-extensions", - "urllib3<2", # requests-unixsocket does not yet work with urllib3 v2.0+ "validators>=0.28.3", ] diff --git a/debian/snapcraft-completion b/snap/local/snapcraft-completion similarity index 100% rename from debian/snapcraft-completion rename to snap/local/snapcraft-completion diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 4cdd587559..d81c623409 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -49,7 +49,7 @@ build-packages: parts: bash-completion: - source: debian + source: snap/local plugin: dump stage: - snapcraft-completion @@ -140,11 +140,12 @@ parts: -e 's/^ENABLE_USER_SITE = None$/ENABLE_USER_SITE = False/' libgit2: - source: https://github.com/libgit2/libgit2/archive/refs/tags/v1.7.1.tar.gz - source-checksum: sha256/17d2b292f21be3892b704dddff29327b3564f96099a1c53b00edc23160c71327 + source: https://github.com/libgit2/libgit2/archive/refs/tags/v1.7.2.tar.gz + source-checksum: sha256/de384e29d7efc9330c6cdb126ebf88342b5025d920dcb7c645defad85195ea7f plugin: cmake cmake-parameters: - -DCMAKE_INSTALL_PREFIX=/usr + - -DCMAKE_BUILD_TYPE=RelWithDebInfo build-attributes: - enable-patchelf prime: @@ -171,7 +172,7 @@ parts: build-environment: # Build PyNaCl from source since the wheel files interact # strangely with classic snaps. Well, build it all from source. - - "PIP_NO_BINARY": ":all" + - "PIP_NO_BINARY": ":all:" # Use base image's libsodium for PyNaCl. - "SODIUM_INSTALL": "system" - "CFLAGS": "$(pkg-config python-3.10 yaml-0.1 --cflags)" diff --git a/snapcraft/application.py b/snapcraft/application.py index df84454fa8..0b0f96281c 100644 --- a/snapcraft/application.py +++ b/snapcraft/application.py @@ -135,16 +135,13 @@ def _register_default_plugins(self) -> None: """Register per application plugins when initializing.""" super()._register_default_plugins() - # poetry plugin needs integration work, see #5025 - craft_parts.plugins.unregister("poetry") - if self._known_core24: # dotnet is disabled for core24 and newer because it is pending a rewrite craft_parts.plugins.unregister("dotnet") @override def _configure_services(self, provider_name: str | None) -> None: - self.services.set_kwargs( + self.services.update_kwargs( "package", build_plan=self._build_plan, snapcraft_yaml_path=self._snapcraft_yaml_path, diff --git a/snapcraft/commands/registries.py b/snapcraft/commands/registries.py index 95fe349df2..d71d5b7613 100644 --- a/snapcraft/commands/registries.py +++ b/snapcraft/commands/registries.py @@ -82,6 +82,8 @@ class StoreEditRegistriesCommand(craft_application.commands.AppCommand): If the registries set does not exist, then a new registries set will be created. + If a key name is not provided, the default key is used. + The account ID of the authenticated account can be determined with the ``snapcraft whoami`` command. @@ -100,10 +102,14 @@ def fill_parser(self, parser: "argparse.ArgumentParser") -> None: parser.add_argument( "name", metavar="name", help="Name of the registries set to edit" ) + parser.add_argument( + "--key-name", metavar="key-name", help="Key used to sign the registries set" + ) @override def run(self, parsed_args: "argparse.Namespace"): self._services.registries.edit_assertion( name=parsed_args.name, account_id=parsed_args.account_id, + key_name=parsed_args.key_name, ) diff --git a/snapcraft/commands/remote.py b/snapcraft/commands/remote.py index 2ac7b0e2b3..a38ea34a1f 100644 --- a/snapcraft/commands/remote.py +++ b/snapcraft/commands/remote.py @@ -308,7 +308,7 @@ def _run( # noqa: PLR0915 [too-many-statements] emit.progress("Remote repository already exists.", permanent=True) emit.progress("Cleaning up") builder.cleanup() - return 75 + return os.EX_TEMPFAIL try: returncode = self._monitor_and_complete(build_id, builds) @@ -316,10 +316,13 @@ def _run( # noqa: PLR0915 [too-many-statements] if confirm_with_user("Cancel builds?", default=True): emit.progress("Cancelling builds.") builder.cancel_builds() - returncode = 0 + emit.progress("Cleaning up.") + builder.cleanup() + return os.EX_OK except Exception: # noqa: BLE001 [blind-except] returncode = 1 # General error on any other exception - if returncode != 75: # TimeoutError + + if returncode != os.EX_TEMPFAIL: emit.progress("Cleaning up") builder.cleanup() return returncode diff --git a/snapcraft/commands/validation_sets.py b/snapcraft/commands/validation_sets.py index 50f1ef97ed..d310d3aeeb 100644 --- a/snapcraft/commands/validation_sets.py +++ b/snapcraft/commands/validation_sets.py @@ -48,6 +48,12 @@ # the provided name. # presence: [required|optional|invalid] # Optional, defaults to required. # revision: # The revision of the snap. Optional. + # components: # Constraints to apply to the snap's components. Optional. + # : [required|optional|invalid] # Short form for specifying the component's presence. + # : # Long form that allows specifying the component's revision. + # presence: [required|optional|invalid] # Presence of the component. Required. + # revision: # The revision of the component, required if the snap's revision is given. + # Otherwise, not allowed. """ ) @@ -136,7 +142,9 @@ def _submit_validation_set( key_name: Optional[str], store_client: StoreClientCLI, ) -> None: - emit.debug(f"Posting assertion to build: {edited_validation_sets.json()}") + emit.debug( + f"Posting assertion to build: {edited_validation_sets.model_dump_json()}" + ) build_assertion = store_client.post_validation_sets_build_assertion( validation_sets=edited_validation_sets.marshal() ) @@ -148,7 +156,7 @@ def _submit_validation_set( response = store_client.post_validation_sets( signed_validation_sets=signed_validation_sets ) - emit.debug(f"Response: {response.json()}") + emit.debug(f"Response: {response.model_dump_json()}") def _generate_template( diff --git a/snapcraft/errors.py b/snapcraft/errors.py index 408c2fcb02..49c88f32ee 100644 --- a/snapcraft/errors.py +++ b/snapcraft/errors.py @@ -173,3 +173,10 @@ def __init__(self, message: str, *, resolution: str) -> None: resolution=resolution, docs_url="https://snapcraft.io/docs/snapcraft-authentication", ) + + +class SnapcraftAssertionError(SnapcraftError): + """Error raised when an assertion (validation or registries set) is invalid. + + Not to be confused with Python's built-in AssertionError. + """ diff --git a/snapcraft/linters/linters.py b/snapcraft/linters/linters.py index 507c8642cc..798d796f7a 100644 --- a/snapcraft/linters/linters.py +++ b/snapcraft/linters/linters.py @@ -87,7 +87,7 @@ def report( issues_by_result.setdefault(issue.result, []).append(issue) if json_output: - display(json.dumps([x.dict(exclude_none=True) for x in issues])) + display(json.dumps([x.model_dump(exclude_none=True) for x in issues])) else: # show issues by result for result, header in _lint_reports.items(): diff --git a/snapcraft/models/assertions.py b/snapcraft/models/assertions.py index d557ff9092..efe6a30a4e 100644 --- a/snapcraft/models/assertions.py +++ b/snapcraft/models/assertions.py @@ -16,13 +16,44 @@ """Assertion models.""" -from typing import Literal +import numbers +from collections import abc +from typing import Any, Literal import pydantic from craft_application import models from typing_extensions import Self +def cast_dict_scalars_to_strings(data: dict) -> dict: + """Cast all scalars in a dictionary to strings. + + Supported scalar types are str, bool, and numbers. + """ + return {_to_string(key): _to_string(value) for key, value in data.items()} + + +def _to_string(data: Any) -> Any: + """Recurse through nested dicts and lists and cast scalar values to strings. + + Supported scalar types are str, bool, and numbers. + """ + # check for a string first, as it is the most common scenario + if isinstance(data, str): + return data + + if isinstance(data, abc.Mapping): + return {_to_string(key): _to_string(value) for key, value in data.items()} + + if isinstance(data, abc.Collection): + return [_to_string(i) for i in data] + + if isinstance(data, (numbers.Number, bool)): + return str(data) + + return data + + class Registry(models.CraftBaseModel): """Access and data definitions for a specific facet of a snap or system.""" @@ -52,7 +83,6 @@ class EditableRegistryAssertion(models.CraftBaseModel): """Issuer of the registry assertion and owner of the signing key.""" name: str - summary: str | None = None revision: int | None = 0 views: dict[str, Rules] @@ -61,6 +91,10 @@ class EditableRegistryAssertion(models.CraftBaseModel): body: str | None = None """A JSON schema that defines the storage structure.""" + def marshal_scalars_as_strings(self) -> dict[str, Any]: + """Marshal the model where all scalars are represented as strings.""" + return cast_dict_scalars_to_strings(self.marshal()) + class RegistryAssertion(EditableRegistryAssertion): """A full registries assertion containing editable and non-editable fields.""" diff --git a/snapcraft/parts/plugins/__init__.py b/snapcraft/parts/plugins/__init__.py index 6104dfed0c..b641244c53 100644 --- a/snapcraft/parts/plugins/__init__.py +++ b/snapcraft/parts/plugins/__init__.py @@ -22,6 +22,7 @@ from .flutter_plugin import FlutterPlugin from .kernel_plugin import KernelPlugin from .matter_sdk_plugin import MatterSdkPlugin +from .poetry_plugin import PoetryPlugin from .python_plugin import PythonPlugin from .register import get_plugins, register @@ -31,6 +32,7 @@ "FlutterPlugin", "MatterSdkPlugin", "KernelPlugin", + "PoetryPlugin", "PythonPlugin", "get_plugins", "register", diff --git a/snapcraft/parts/plugins/poetry_plugin.py b/snapcraft/parts/plugins/poetry_plugin.py new file mode 100644 index 0000000000..efb3804edf --- /dev/null +++ b/snapcraft/parts/plugins/poetry_plugin.py @@ -0,0 +1,30 @@ +# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- +# +# Copyright 2024 Canonical Ltd. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 3 as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +"""The Snapcraft Poetry plugin.""" + +from craft_parts.plugins import poetry_plugin +from overrides import override + +from snapcraft.parts.plugins import python_common + + +class PoetryPlugin(poetry_plugin.PoetryPlugin): + """A Poetry plugin for Snapcraft.""" + + @override + def _get_system_python_interpreter(self) -> str | None: + return python_common.get_system_interpreter(self._part_info) diff --git a/snapcraft/parts/plugins/python_common.py b/snapcraft/parts/plugins/python_common.py new file mode 100644 index 0000000000..f9c4a7e525 --- /dev/null +++ b/snapcraft/parts/plugins/python_common.py @@ -0,0 +1,96 @@ +# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- +# +# Copyright 2023-2024 Canonical Ltd. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 3 as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +"""Common functionality for Python-based plugins. + +This plugin extends Craft-parts' vanilla Python plugin to properly +set the Python interpreter according to the Snapcraft base and +confinement parameters. +""" + +import logging +from pathlib import Path + +from craft_parts import PartInfo, StepInfo, errors + +logger = logging.getLogger(__name__) + + +_CONFINED_PYTHON_PATH = { + "core22": "/usr/bin/python3.10", + "core24": "/usr/bin/python3.12", +} + + +def get_system_interpreter(part_info: PartInfo) -> str | None: + """Obtain the path to the system-provided python interpreter. + + :param part_info: The info of the part that is being built. + """ + base = part_info.project_base + confinement = part_info.confinement + + if confinement == "classic" or base == "bare": + # classic snaps, and snaps without bases, must always provision Python + interpreter = None + else: + # otherwise, we should always know which Python is present on the + # base. If this fails on a new base, update _CONFINED_PYTHON_PATH + interpreter = _CONFINED_PYTHON_PATH.get(base) + if interpreter is None: + brief = f"Don't know which interpreter to use for base {base}." + resolution = "Please contact the Snapcraft team." + raise errors.PartsError(brief=brief, resolution=resolution) + + logger.debug( + "Using python interpreter '%s' for base '%s', confinement '%s'", + interpreter, + base, + confinement, + ) + return interpreter + + +def post_prime(step_info: StepInfo) -> None: + """Perform Python-specific actions right before packing.""" + base = step_info.project_base + + if base in ("core20", "core22"): + # Only fix pyvenv.cfg on core24+ snaps + return + + root_path: Path = step_info.prime_dir + + pyvenv = root_path / "pyvenv.cfg" + if not pyvenv.is_file(): + return + + snap_path = Path(f"/snap/{step_info.project_name}/current") + new_home = f"home = {snap_path}" + + candidates = ( + step_info.part_install_dir, + step_info.stage_dir, + ) + + old_contents = contents = pyvenv.read_text() + for candidate in candidates: + old_home = f"home = {candidate}" + contents = contents.replace(old_home, new_home) + + if old_contents != contents: + logger.debug("Updating pyvenv.cfg to:\n%s", contents) + pyvenv.write_text(contents) diff --git a/snapcraft/parts/plugins/python_plugin.py b/snapcraft/parts/plugins/python_plugin.py index df20f19871..63a306f85d 100644 --- a/snapcraft/parts/plugins/python_plugin.py +++ b/snapcraft/parts/plugins/python_plugin.py @@ -16,84 +16,17 @@ """The Snapcraft Python plugin.""" -import logging -from pathlib import Path from typing import Optional -from craft_parts import StepInfo, errors from craft_parts.plugins import python_plugin from overrides import override -logger = logging.getLogger(__name__) - - -_CONFINED_PYTHON_PATH = { - "core22": "/usr/bin/python3.10", - "core24": "/usr/bin/python3.12", -} +from snapcraft.parts.plugins import python_common class PythonPlugin(python_plugin.PythonPlugin): - """A Python plugin for Snapcraft. - - This plugin extends Craft-parts' vanilla Python plugin to properly - set the Python interpreter according to the Snapcraft base and - confinement parameters. - """ + """A Python plugin for Snapcraft.""" @override def _get_system_python_interpreter(self) -> Optional[str]: - base = self._part_info.project_base - confinement = self._part_info.confinement - - if confinement == "classic" or base == "bare": - # classic snaps, and snaps without bases, must always provision Python - interpreter = None - else: - # otherwise, we should always know which Python is present on the - # base. If this fails on a new base, update _CONFINED_PYTHON_PATH - interpreter = _CONFINED_PYTHON_PATH.get(base) - if interpreter is None: - brief = f"Don't know which interpreter to use for base {base}." - resolution = "Please contact the Snapcraft team." - raise errors.PartsError(brief=brief, resolution=resolution) - - logger.debug( - "Using python interpreter '%s' for base '%s', confinement '%s'", - interpreter, - base, - confinement, - ) - return interpreter - - @classmethod - def post_prime(cls, step_info: StepInfo) -> None: - """Perform Python-specific actions right before packing.""" - base = step_info.project_base - - if base in ("core20", "core22"): - # Only fix pyvenv.cfg on core24+ snaps - return - - root_path: Path = step_info.prime_dir - - pyvenv = root_path / "pyvenv.cfg" - if not pyvenv.is_file(): - return - - snap_path = Path(f"/snap/{step_info.project_name}/current") - new_home = f"home = {snap_path}" - - candidates = ( - step_info.part_install_dir, - step_info.stage_dir, - ) - - old_contents = contents = pyvenv.read_text() - for candidate in candidates: - old_home = f"home = {candidate}" - contents = contents.replace(old_home, new_home) - - if old_contents != contents: - logger.debug("Updating pyvenv.cfg to:\n%s", contents) - pyvenv.write_text(contents) + return python_common.get_system_interpreter(self._part_info) diff --git a/snapcraft/parts/plugins/register.py b/snapcraft/parts/plugins/register.py index 5d578462a0..7f8b56c6c9 100644 --- a/snapcraft/parts/plugins/register.py +++ b/snapcraft/parts/plugins/register.py @@ -24,6 +24,7 @@ from .flutter_plugin import FlutterPlugin from .kernel_plugin import KernelPlugin from .matter_sdk_plugin import MatterSdkPlugin +from .poetry_plugin import PoetryPlugin from .python_plugin import PythonPlugin @@ -38,6 +39,7 @@ def get_plugins(core22: bool) -> dict[str, PluginType]: "flutter": FlutterPlugin, "python": PythonPlugin, "matter-sdk": MatterSdkPlugin, + "poetry": PoetryPlugin, } if core22: diff --git a/snapcraft/services/assertions.py b/snapcraft/services/assertions.py index b3650b7883..c5aa03e876 100644 --- a/snapcraft/services/assertions.py +++ b/snapcraft/services/assertions.py @@ -33,6 +33,7 @@ from craft_application.errors import CraftValidationError from craft_application.services import base from craft_application.util import safe_yaml_load +from craft_store.errors import StoreServerError from typing_extensions import override from snapcraft import const, errors, models, store, utils @@ -68,6 +69,24 @@ def _get_assertions(self, name: str | None = None) -> list[models.Assertion]: :returns: A list of assertions. """ + @abc.abstractmethod + def _build_assertion(self, assertion: models.EditableAssertion) -> models.Assertion: + """Build an assertion from an editable assertion. + + :param assertion: The editable assertion to build. + + :returns: The built assertion. + """ + + @abc.abstractmethod + def _post_assertion(self, assertion_data: bytes) -> models.Assertion: + """Post an assertion to the store. + + :param assertion_data: A signed assertion represented as bytes. + + :returns: The published assertion. + """ + @abc.abstractmethod def _normalize_assertions( self, assertions: list[models.Assertion] @@ -102,6 +121,15 @@ def _generate_yaml_from_template(self, name: str, account_id: str) -> str: :returns: A multi-line yaml string. """ + @abc.abstractmethod + def _get_success_message(self, assertion: models.Assertion) -> str: + """Create a message after an assertion has been successfully posted. + + :param assertion: The published assertion. + + :returns: The success message to log. + """ + def list_assertions(self, *, output_format: str, name: str | None = None) -> None: """List assertions from the store. @@ -150,6 +178,7 @@ def _edit_yaml_file(self, filepath: pathlib.Path) -> models.EditableAssertion: :returns: The edited assertion. """ + craft_cli.emit.progress(f"Editing {self._assertion_name}.") while True: craft_cli.emit.debug(f"Using {self._editor_cmd} to edit file.") with craft_cli.emit.pause(): @@ -161,8 +190,9 @@ def _edit_yaml_file(self, filepath: pathlib.Path) -> models.EditableAssertion: data=data, # filepath is only shown for pydantic errors and snapcraft should # not expose the temp file name - filepath=pathlib.Path(self._assertion_name.replace(" ", "-")), + filepath=pathlib.Path(self._assertion_name), ) + craft_cli.emit.progress(f"Edited {self._assertion_name}.") return edited_assertion except (yaml.YAMLError, CraftValidationError) as err: craft_cli.emit.message(f"{err!s}") @@ -178,12 +208,12 @@ def _get_yaml_data(self, name: str, account_id: str) -> str: if assertions := self._get_assertions(name=name): yaml_data = self._generate_yaml_from_model(assertions[0]) + craft_cli.emit.progress( + f"Retrieved {self._assertion_name} '{name}' from the store.", + ) else: craft_cli.emit.progress( - f"Creating a new {self._assertion_name} because no existing " - f"{self._assertion_name} named '{name}' was found for the " - "authenticated account.", - permanent=True, + f"Could not find an existing {self._assertion_name} named '{name}'.", ) yaml_data = self._generate_yaml_from_template( name=name, account_id=account_id @@ -204,30 +234,83 @@ def _remove_temp_file(filepath: pathlib.Path) -> None: craft_cli.emit.trace(f"Removing temporary file '{filepath}'.") filepath.unlink() - def edit_assertion(self, *, name: str, account_id: str) -> None: + @staticmethod + def _sign_assertion(assertion: models.Assertion, key_name: str | None) -> bytes: + """Sign an assertion with `snap sign`. + + :param assertion: The assertion to sign. + :param key_name: Name of the key to sign the assertion. + + :returns: A signed assertion represented as bytes. + """ + craft_cli.emit.progress("Signing assertion.") + cmdline = ["snap", "sign"] + if key_name: + cmdline += ["-k", key_name] + + # snapd expects a json string where all scalars are strings + unsigned_assertion = json.dumps(assertion.marshal_scalars_as_strings()) + + try: + # pause the emitter for passphrase prompts + with craft_cli.emit.pause(): + signed_assertion = subprocess.check_output( + cmdline, input=unsigned_assertion.encode() + ) + except subprocess.CalledProcessError as sign_error: + raise errors.SnapcraftAssertionError( + "Failed to sign assertion" + ) from sign_error + + craft_cli.emit.progress("Signed assertion.") + craft_cli.emit.trace(f"Signed assertion: {signed_assertion.decode()}") + return signed_assertion + + def edit_assertion( + self, *, name: str, account_id: str, key_name: str | None = None + ) -> None: """Edit, sign and upload an assertion. If the assertion does not exist, a new assertion is created from a template. :param name: The name of the assertion to edit. :param account_id: The account ID associated with the registries set. + :param key_name: Name of the key to sign the assertion. """ yaml_data = self._get_yaml_data(name=name, account_id=account_id) yaml_file = self._write_to_file(yaml_data) original_assertion = self._editable_assertion_class.unmarshal( safe_yaml_load(io.StringIO(yaml_data)) ) - edited_assertion = self._edit_yaml_file(yaml_file) - if edited_assertion == original_assertion: - craft_cli.emit.message("No changes made.") + try: + while True: + try: + edited_assertion = self._edit_yaml_file(yaml_file) + if edited_assertion == original_assertion: + craft_cli.emit.message("No changes made.") + break + + craft_cli.emit.progress(f"Building {self._assertion_name}.") + built_assertion = self._build_assertion(edited_assertion) + craft_cli.emit.progress(f"Built {self._assertion_name}.") + + signed_assertion = self._sign_assertion(built_assertion, key_name) + published_assertion = self._post_assertion(signed_assertion) + craft_cli.emit.message( + self._get_success_message(published_assertion) + ) + break + except ( + StoreServerError, + errors.SnapcraftAssertionError, + ) as assertion_error: + craft_cli.emit.message(str(assertion_error)) + if not utils.confirm_with_user( + f"Do you wish to amend the {self._assertion_name}?" + ): + raise errors.SnapcraftError( + "operation aborted" + ) from assertion_error + finally: self._remove_temp_file(yaml_file) - return - - # TODO: build, sign, and push assertion (#5018) - - self._remove_temp_file(yaml_file) - craft_cli.emit.message(f"Successfully edited {self._assertion_name} {name!r}.") - raise errors.FeatureNotImplemented( - f"Building, signing and uploading {self._assertion_name} is not implemented.", - ) diff --git a/snapcraft/services/lifecycle.py b/snapcraft/services/lifecycle.py index 61f8f95472..f093468280 100644 --- a/snapcraft/services/lifecycle.py +++ b/snapcraft/services/lifecycle.py @@ -86,7 +86,7 @@ def setup(self) -> None: @overrides def post_prime(self, step_info: StepInfo) -> bool: """Run post-prime parts steps for Snapcraft.""" - from snapcraft.parts import plugins + from snapcraft.parts.plugins import python_common project = cast(models.Project, self._project) @@ -94,8 +94,8 @@ def post_prime(self, step_info: StepInfo) -> bool: plugin_name = project.parts[part_name]["plugin"] # Handle plugin-specific prime fixes - if plugin_name == "python": - plugins.PythonPlugin.post_prime(step_info) + if plugin_name in ("python", "poetry"): + python_common.post_prime(step_info) # Handle patch-elf diff --git a/snapcraft/services/registries.py b/snapcraft/services/registries.py index e6cd785c16..ce4de0c18f 100644 --- a/snapcraft/services/registries.py +++ b/snapcraft/services/registries.py @@ -31,7 +31,6 @@ """\ account-id: {account_id} name: {set_name} - # summary: {summary} # The revision for this registries set # revision: {revision} {views} @@ -85,6 +84,14 @@ def _editable_assertion_class(self) -> type[models.EditableAssertion]: def _get_assertions(self, name: str | None = None) -> list[models.Assertion]: return self._store_client.list_registries(name=name) + @override + def _build_assertion(self, assertion: models.EditableAssertion) -> models.Assertion: + return self._store_client.build_registries(registries=assertion) + + @override + def _post_assertion(self, assertion_data: bytes) -> models.Assertion: + return self._store_client.post_registries(registries_data=assertion_data) + @override def _normalize_assertions( self, assertions: list[models.Assertion] @@ -110,7 +117,6 @@ def _generate_yaml_from_model(self, assertion: models.Assertion) -> str: {"views": assertion.marshal().get("views")}, default_flow_style=False ), body=dump_yaml({"body": assertion.body}, default_flow_style=False), - summary=assertion.summary, set_name=assertion.name, revision=assertion.revision, ) @@ -121,7 +127,10 @@ def _generate_yaml_from_template(self, name: str, account_id: str) -> str: account_id=account_id, views=_REGISTRY_SETS_VIEWS_TEMPLATE, body=_REGISTRY_SETS_BODY_TEMPLATE, - summary="A brief summary of the registries set", set_name=name, revision=1, ) + + @override + def _get_success_message(self, assertion: models.Assertion) -> str: + return f"Successfully created revision {assertion.revision!r} for {assertion.name!r}." diff --git a/snapcraft/store/client.py b/snapcraft/store/client.py index bbb58aed43..6170c5d8e2 100644 --- a/snapcraft/store/client.py +++ b/snapcraft/store/client.py @@ -23,7 +23,9 @@ from typing import Any, Dict, List, Optional, Sequence, Tuple, cast import craft_store +import pydantic import requests +from craft_application.util.error_formatting import format_pydantic_errors from craft_cli import emit from overrides import overrides @@ -34,8 +36,6 @@ from ._legacy_account import LegacyUbuntuOne from .onprem_client import ON_PREM_ENDPOINTS, OnPremClient -_TESTING_ENV_PREFIXES = ["TRAVIS", "AUTOPKGTEST_TMP"] - _POLL_DELAY = 1 _HUMAN_STATUS = { "being_processed": "processing", @@ -51,13 +51,7 @@ def build_user_agent( os_platform: utils.OSPlatform = utils.get_os_platform(), # noqa: B008 ): """Build Snapcraft's user agent.""" - if any( - key.startswith(prefix) for prefix in _TESTING_ENV_PREFIXES for key in os.environ - ): - testing = " (testing) " - else: - testing = " " - return f"snapcraft/{version}{testing}{os_platform!s}" + return f"snapcraft/{version} {os_platform!s}" def use_candid() -> bool: @@ -503,6 +497,22 @@ def list_revisions(self, snap_name: str) -> Revisions: return Revisions.unmarshal(response.json()) + @staticmethod + def _unmarshal_registries_set(registries_data) -> models.RegistryAssertion: + """Unmarshal a registries set. + + :raises StoreAssertionError: If the registries set cannot be unmarshalled. + """ + try: + return models.RegistryAssertion.unmarshal(registries_data) + except pydantic.ValidationError as err: + raise errors.SnapcraftAssertionError( + message="Received invalid registries set from the store", + # this is an unexpected failure that the user can't fix, so hide + # the response in the details + details=f"{format_pydantic_errors(err.errors(), file_name='registries set')}", + ) from err + def list_registries( self, *, name: str | None = None ) -> list[models.RegistryAssertion]: @@ -526,16 +536,75 @@ def list_registries( registry_assertions = [] if assertions := response.json().get("assertions"): for assertion_data in assertions: - emit.debug(f"Parsing assertion: {assertion_data}") # move body into model - assertion_data["headers"]["body"] = assertion_data["body"] - assertion = models.RegistryAssertion.unmarshal( - assertion_data["headers"] - ) + assertion_data["headers"]["body"] = assertion_data.get("body") + + assertion = self._unmarshal_registries_set(assertion_data["headers"]) registry_assertions.append(assertion) + emit.debug(f"Parsed registries set: {assertion.model_dump_json()}") return registry_assertions + def build_registries( + self, *, registries: models.EditableRegistryAssertion + ) -> models.RegistryAssertion: + """Build a registries set. + + Sends an edited registries set to the store, which validates the data, + populates additional fields, and returns the registries set. + + :param registries: The registries set to build. + + :returns: The built registries set. + """ + response = self.request( + "POST", + f"{self._base_url}/api/v2/registries/build-assertion", + headers={ + "Content-Type": "application/json", + "Accept": "application/json", + }, + json=registries.marshal(), + ) + + assertion = self._unmarshal_registries_set(response.json()) + emit.debug(f"Built registries set: {assertion.model_dump_json()}") + return assertion + + def post_registries(self, *, registries_data: bytes) -> models.RegistryAssertion: + """Send a registries set to be published. + + :param registries_data: A signed registries set represented as bytes. + + :returns: The published assertion. + """ + response = self.request( + "POST", + f"{self._base_url}/api/v2/registries", + headers={ + "Accept": "application/json", + "Content-Type": "application/x.ubuntu.assertion", + }, + data=registries_data, + ) + + assertions = response.json().get("assertions") + + if not assertions or len(assertions) != 1: + raise errors.SnapcraftAssertionError( + message="Received invalid registries set from the store", + # this is an unexpected failure that the user can't fix, so hide + # the response in the details + details=f"Received data: {assertions}", + ) + + # move body into model + assertions[0]["headers"]["body"] = assertions[0]["body"] + + assertion = self._unmarshal_registries_set(assertions[0]["headers"]) + emit.debug(f"Published registries set: {assertion.model_dump_json()}") + return assertion + class OnPremStoreClientCLI(LegacyStoreClientCLI): """On Premises Store Client command line interface.""" diff --git a/snapcraft_legacy/internal/build_providers/_snap.py b/snapcraft_legacy/internal/build_providers/_snap.py index 7bbb8b0063..28a9d757f1 100644 --- a/snapcraft_legacy/internal/build_providers/_snap.py +++ b/snapcraft_legacy/internal/build_providers/_snap.py @@ -58,9 +58,10 @@ def __init__( latest_revision: Optional[str], inject_from_host: bool = True ) -> None: - self.snap_name = snap_name - # the local snap name may have a suffix if it was installed with `--name` - self.snap_store_name = snap_name.split("_")[0] + # name of the snap instance, which may have an alias + self.snap_instance_name = snap_name + # name of the snap (no alias) + self.snap_name = snap_name.split("_")[0] self._remote_snap_dir = remote_snap_dir self._inject_from_host = inject_from_host @@ -74,7 +75,7 @@ def __init__( def _get_snap_repo(self): if self.__repo is None: - self.__repo = repo.snaps.SnapPackage(self.snap_name) + self.__repo = repo.snaps.SnapPackage(self.snap_instance_name) return self.__repo def get_op(self) -> _SnapOp: @@ -125,7 +126,7 @@ def get_op(self) -> _SnapOp: # This is a programmatic error raise RuntimeError( "Unhandled scenario for {!r} (host installed: {}, latest_revision {})".format( - self.snap_name, is_installed, self._latest_revision + self.snap_instance_name, is_installed, self._latest_revision ) ) @@ -136,9 +137,9 @@ def push_host_snap(self, *, file_pusher: Callable[..., None]) -> None: # TODO not being able to lock down on a snap revision can lead to races. host_snap_repo = self._get_snap_repo() with tempfile.TemporaryDirectory() as temp_dir: - snap_file_path = os.path.join(temp_dir, "{}.snap".format(self.snap_name)) + snap_file_path = os.path.join(temp_dir, "{}.snap".format(self.snap_instance_name)) assertion_file_path = os.path.join( - temp_dir, "{}.assert".format(self.snap_name) + temp_dir, "{}.assert".format(self.snap_instance_name) ) host_snap_repo.local_download( snap_path=snap_file_path, assertion_path=assertion_file_path @@ -169,11 +170,7 @@ def _set_data(self) -> None: if not snap_revision.startswith("x") and snap_channel: switch_cmd = [ - "snap", - "switch", - self.snap_name, - "--channel", - snap_channel, + "snap", "switch", self.snap_name, "--channel", snap_channel ] if snap_revision.startswith("x"): @@ -198,9 +195,9 @@ def _set_data(self) -> None: elif op == _SnapOp.INSTALL or op == _SnapOp.REFRESH: install_cmd = ["snap", op.name.lower()] - snap_channel = _get_snap_channel(self.snap_store_name) + snap_channel = _get_snap_channel(self.snap_name) - store_snap_info = storeapi.SnapAPI().get_info(self.snap_store_name) + store_snap_info = storeapi.SnapAPI().get_info(self.snap_name) snap_channel_map = store_snap_info.get_channel_mapping( risk=snap_channel.risk, track=snap_channel.track ) @@ -208,7 +205,7 @@ def _set_data(self) -> None: if snap_channel_map.confinement == "classic": install_cmd.append("--classic") install_cmd.extend(["--channel", snap_channel_map.channel_details.name]) - install_cmd.append(self.snap_store_name) + install_cmd.append(self.snap_name) self.__install_cmd = install_cmd self.__switch_cmd = switch_cmd @@ -224,7 +221,7 @@ def get_revision(self) -> str: # Shouldn't happen. raise RuntimeError( "Unhandled scenario for {!r} (revision {})".format( - self.snap_name, self.__revision + self.snap_instance_name, self.__revision ) ) @@ -238,7 +235,7 @@ def get_snap_install_cmd(self) -> List[str]: if self.__install_cmd is None: raise RuntimeError( "Unhandled scenario for {!r} (install_cmd {})".format( - self.snap_name, self.__install_cmd + self.snap_instance_name, self.__install_cmd ) ) @@ -259,7 +256,7 @@ def get_assertion_ack_cmd(self) -> List[str]: if self.__assertion_ack_cmd is None: raise RuntimeError( "Unhandled scenario for {!r} (assertion_ack_cmd {})".format( - self.snap_name, self.__assertion_ack_cmd + self.snap_instance_name, self.__assertion_ack_cmd ) ) @@ -379,7 +376,7 @@ def apply(self) -> None: return # Allow using snapd from the snapd snap to leverage newer snapd features. - if any(s.snap_name == "snapd" for s in self._snaps): + if any(s.snap_instance_name == "snapd" for s in self._snaps): self._enable_snapd_snap() # Disable refreshes so they do not interfere with installation ops. @@ -396,6 +393,6 @@ def apply(self) -> None: self._runner(snap.get_snap_install_cmd()) if snap.get_channel_switch_cmd() is not None: self._runner(snap.get_channel_switch_cmd()) - self._record_revision(snap.snap_store_name, snap.get_revision()) + self._record_revision(snap.snap_name, snap.get_revision()) _save_registry(self._registry_data, self._registry_filepath) diff --git a/snapcraft_legacy/internal/repo/snaps.py b/snapcraft_legacy/internal/repo/snaps.py index 75e286c5fc..0a779b0550 100644 --- a/snapcraft_legacy/internal/repo/snaps.py +++ b/snapcraft_legacy/internal/repo/snaps.py @@ -179,7 +179,13 @@ def local_download(self, *, snap_path: str, assertion_path: str) -> None: # We write an empty assertions file for dangerous installs to # have a consistent interface. if self.has_assertions(): - assertions.append(["snap-declaration", "snap-name={}".format(self.name)]) + assertions.append( + [ + "snap-declaration", + # use the snap name without any alias + f"snap-name={self.name.partition('_')[0]}" + ] + ) assertions.append( [ "snap-revision", diff --git a/snapcraft_legacy/storeapi/agent.py b/snapcraft_legacy/storeapi/agent.py index 04d516e75b..66c982829a 100644 --- a/snapcraft_legacy/storeapi/agent.py +++ b/snapcraft_legacy/storeapi/agent.py @@ -14,7 +14,6 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -import os import sys import snapcraft_legacy @@ -23,16 +22,6 @@ from snapcraft_legacy.internal.errors import OsReleaseNameError, OsReleaseVersionIdError -def _is_ci_env(): - env_prefixes = ["TRAVIS", "AUTOPKGTEST_TMP"] - matches = [] - - for prefix in env_prefixes: - matches += [var for var in os.environ.keys() if var.startswith(prefix)] - - return len(matches) > 0 - - def _get_linux_release(release: os_release.OsRelease) -> str: try: os_name = release.name() @@ -48,11 +37,10 @@ def _get_linux_release(release: os_release.OsRelease) -> str: def get_user_agent(platform: str = sys.platform) -> str: arch = project.Project().deb_arch - testing = "(testing) " if _is_ci_env() else "" if platform == "linux": os_platform = _get_linux_release(os_release.OsRelease()) else: os_platform = platform.title() - return f"snapcraft/{snapcraft_legacy.__version__} {testing}{os_platform} ({arch})" + return f"snapcraft/{snapcraft_legacy.__version__} {os_platform} ({arch})" diff --git a/snapcraft_legacy/storeapi/v2/validation_sets.py b/snapcraft_legacy/storeapi/v2/validation_sets.py index 3dc7b68c45..90f0545c79 100644 --- a/snapcraft_legacy/storeapi/v2/validation_sets.py +++ b/snapcraft_legacy/storeapi/v2/validation_sets.py @@ -56,6 +56,16 @@ def _to_string( return data +Presence = Literal["required", "optional", "invalid"] + +class Component(models.CraftBaseModel): + """Represent a Component in a Validation Set.""" + + presence: Presence + """Component presence""" + + revision: int | None = None + """Component revision""" class Snap(models.CraftBaseModel): """Represent a Snap in a Validation Set.""" @@ -66,12 +76,14 @@ class Snap(models.CraftBaseModel): id: SnapId | None = None """Snap ID""" - presence: Literal["required", "optional", "invalid"] | None = None + presence: Presence | None = None """Snap presence""" revision: int | None = None """Snap revision""" + components: dict[str, Presence | Component] | None = None + """Snap components""" class EditableBuildAssertion(models.CraftBaseModel): """Subset of a build assertion that can be edited by the user. diff --git a/spread.yaml b/spread.yaml index 039ef727b3..b7ac155b78 100644 --- a/spread.yaml +++ b/spread.yaml @@ -121,51 +121,6 @@ backends: username: root password: ubuntu - autopkgtest: - type: adhoc - allocate: | - echo "Allocating ad-hoc $SPREAD_SYSTEM" - if [ -z "${ADT_ARTIFACTS:-}" ]; then - FATAL "adhoc only works inside autopkgtest" - exit 1 - fi - echo 'ubuntu ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/99-spread-users - ADDRESS localhost:22 - discard: echo "Discarding ad-hoc $SPREAD_SYSTEM" - systems: - # Focal - - ubuntu-20.04-amd64: - username: ubuntu - password: ubuntu - - ubuntu-20.04-ppc64el: - username: ubuntu - password: ubuntu - - ubuntu-20.04-armhf: - username: ubuntu - password: ubuntu - - ubuntu-20.04-s390x: - username: ubuntu - password: ubuntu - - ubuntu-20.04-arm64: - username: ubuntu - password: ubuntu - # Jammy - - ubuntu-22.04-amd64: - username: ubuntu - password: ubuntu - - ubuntu-22.04-ppc64el: - username: ubuntu - password: ubuntu - - ubuntu-22.04-armhf: - username: ubuntu - password: ubuntu - - ubuntu-22.04-s390x: - username: ubuntu - password: ubuntu - - ubuntu-22.04-arm64: - username: ubuntu - password: ubuntu - exclude: [snaps-cache/] prepare: | @@ -342,14 +297,12 @@ suites: - ubuntu-20.04-64 - ubuntu-22.04-64 kill-timeout: 180m - warn-timeout: 9m # Keep less than 10 minutes so Travis can't timeout priority: 90 # Run this test relatively early since fetching images can take time tests/spread/providers/legacy/: summary: tests of snapcraft using build providers systems: - ubuntu-20.04-64 kill-timeout: 180m - warn-timeout: 9m # Keep less than 10 minutes so Travis can't timeout priority: 90 # Run this test relatively early since fetching images can take time # Plugin-specific suites diff --git a/tests/legacy/fake_servers/snapd.py b/tests/legacy/fake_servers/snapd.py index 4616b28a32..be5c52a01f 100644 --- a/tests/legacy/fake_servers/snapd.py +++ b/tests/legacy/fake_servers/snapd.py @@ -53,7 +53,6 @@ def _handle_snaps(self): def _handle_snap_file(self, parsed_url): self.send_response(200) - self.send_header("Content-Length", len(parsed_url)) self.send_header("Content-type", "text/plain") self.end_headers() self.wfile.write(parsed_url.encode()) diff --git a/tests/legacy/unit/build_providers/test_snap.py b/tests/legacy/unit/build_providers/test_snap.py index 40bff35b19..762ad15c88 100644 --- a/tests/legacy/unit/build_providers/test_snap.py +++ b/tests/legacy/unit/build_providers/test_snap.py @@ -162,6 +162,124 @@ def test_snapcraft_installed_on_host_from_store(self): ), ) + def test_snapcraft_installed_on_host_aliased_from_store(self): + self.fake_snapd.snaps_result = [ + { + "name": "snapd", + "confinement": "strict", + "id": "2kkitQ", + "channel": "edge", + "revision": "1", + "tracking-channel": "latest/edge", + }, + { + "name": "core18", + "confinement": "strict", + "id": "2kkibb", + "channel": "stable", + "revision": "123", + "tracking-channel": "latest/beta", + }, + { + "name": "snapcraft_alias", + "confinement": "classic", + "id": "3lljuR", + "channel": "edge", + "revision": "345", + "tracking-channel": "latest/candidate", + }, + ] + self.get_assertion_mock.side_effect = [ + b"fake-assertion-account-store", + b"fake-assertion-declaration-snapd", + b"fake-assertion-revision-snapd-1", + b"fake-assertion-account-store", + b"fake-assertion-declaration-core18", + b"fake-assertion-revision-core18-123", + b"fake-assertion-account-store", + b"fake-assertion-declaration-snapcraft", + b"fake-assertion-revision-snapcraft-345", + ] + + snap_injector = SnapInjector( + registry_filepath=self.registry_filepath, + runner=self.provider._run, + file_pusher=self.provider._push_file, + ) + snap_injector.add("snapd") + snap_injector.add("core18") + snap_injector.add("snapcraft_alias") + snap_injector.apply() + + get_assertion_calls = [ + call( + [ + "account-key", + "public-key-sha3-384=BWDEoaqyr25nF5SNCvEv2v7QnM9QsfCc0PBMYD_i2NGSQ32EF2d4D0hqUel3m8ul", + ] + ), + call(["snap-declaration", "snap-name=snapd"]), + call(["snap-revision", "snap-revision=1", "snap-id=2kkitQ"]), + call( + [ + "account-key", + "public-key-sha3-384=BWDEoaqyr25nF5SNCvEv2v7QnM9QsfCc0PBMYD_i2NGSQ32EF2d4D0hqUel3m8ul", + ] + ), + call(["snap-declaration", "snap-name=core18"]), + call(["snap-revision", "snap-revision=123", "snap-id=2kkibb"]), + call( + [ + "account-key", + "public-key-sha3-384=BWDEoaqyr25nF5SNCvEv2v7QnM9QsfCc0PBMYD_i2NGSQ32EF2d4D0hqUel3m8ul", + ] + ), + call(["snap-declaration", "snap-name=snapcraft"]), + call(["snap-revision", "snap-revision=345", "snap-id=3lljuR"]), + ] + self.get_assertion_mock.assert_has_calls(get_assertion_calls) + self.provider.run_mock.assert_has_calls( + [ + call(["snap", "set", "system", "experimental.snapd-snap=true"]), + call(["snap", "set", "system", ANY]), + call(["snap", "watch", "--last=auto-refresh?"]), + call(["snap", "ack", "/var/tmp/snapd.assert"]), + call(["snap", "install", "/var/tmp/snapd.snap"]), + call(["snap", "switch", "snapd", "--channel", "latest/edge"]), + call(["snap", "ack", "/var/tmp/core18.assert"]), + call(["snap", "install", "/var/tmp/core18.snap"]), + call(["snap", "switch", "core18", "--channel", "latest/beta"]), + call(["snap", "ack", "/var/tmp/snapcraft_alias.assert"]), + call(["snap", "install", "--classic", "/var/tmp/snapcraft_alias.snap"]), + call(["snap", "switch", "snapcraft", "--channel", "latest/candidate"]), + ] + ) + self.provider.push_file_mock.assert_has_calls( + [ + call(source=ANY, destination="/var/tmp/snapd.snap"), + call(source=ANY, destination="/var/tmp/snapd.assert"), + call(source=ANY, destination="/var/tmp/core18.snap"), + call(source=ANY, destination="/var/tmp/core18.assert"), + call(source=ANY, destination="/var/tmp/snapcraft_alias.snap"), + call(source=ANY, destination="/var/tmp/snapcraft_alias.assert"), + ] + ) + self.assertThat( + self.registry_filepath, + FileContains( + dedent( + """\ + core18: + - revision: '123' + snapcraft: + - revision: '345' + snapd: + - revision: '1' + """ + ) + ), + ) + def test_snapcraft_installed_on_host_from_store_but_injection_disabled(self): self.useFixture(fixture_setup.FakeStore()) diff --git a/tests/legacy/unit/repo/test_snaps.py b/tests/legacy/unit/repo/test_snaps.py index bf7f8ffcb6..13d813dbc3 100644 --- a/tests/legacy/unit/repo/test_snaps.py +++ b/tests/legacy/unit/repo/test_snaps.py @@ -348,6 +348,48 @@ def test_download_from_host(self): ] ) + def test_download_from_host_alias(self): + """Download an aliased snap from the host.""" + fake_get_assertion = fixtures.MockPatch( + "snapcraft_legacy.internal.repo.snaps.get_assertion", + return_value=b"foo-assert", + ) + self.useFixture(fake_get_assertion) + + self.fake_snapd.snaps_result = [ + { + "id": "fake-snap-id", + "name": "fake-snap_alias", + "channel": "stable", + "revision": "10", + } + ] + + snap_pkg = snaps.SnapPackage("fake-snap_alias/strict/stable") + snap_pkg.local_download( + snap_path="fake-snap.snap", assertion_path="fake-snap.assert" + ) + + self.assertThat("fake-snap.snap", FileExists()) + self.assertThat( + "fake-snap.assert", FileContains("foo-assert\nfoo-assert\nfoo-assert\n") + ) + fake_get_assertion.mock.assert_has_calls( + [ + mock.call( + [ + "account-key", + "public-key-sha3-384=BWDEoaqyr25nF5SNCvEv2v7QnM9QsfCc0PBMYD_i2NGSQ32EF2d4D0hqUel3m8ul", + ] + ), + # uses the non-aliased name + mock.call(["snap-declaration", "snap-name=fake-snap"]), + mock.call( + ["snap-revision", "snap-revision=10", "snap-id=fake-snap-id"] + ), + ] + ) + def test_download_from_host_dangerous(self): fake_get_assertion = fixtures.MockPatch( "snapcraft_legacy.internal.repo.snaps.get_assertion", diff --git a/tests/legacy/unit/store/test_agent.py b/tests/legacy/unit/store/test_agent.py index 0150c68bc9..acad3a0e13 100644 --- a/tests/legacy/unit/store/test_agent.py +++ b/tests/legacy/unit/store/test_agent.py @@ -14,9 +14,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -import os -import fixtures from testtools.matchers import Equals from snapcraft_legacy import ProjectOptions @@ -54,27 +52,3 @@ def test_user_agent_darwin(self): expected = f"snapcraft/{snapcraft_version} Darwin ({arch})" self.expectThat(agent.get_user_agent(platform="darwin"), Equals(expected)) - - def test_in_travis_ci_env(self): - self.useFixture(fixtures.EnvironmentVariable("TRAVIS_TESTING", "1")) - - self.assertTrue(agent._is_ci_env()) - - def test_in_autopkgtest_ci_env(self): - self.useFixture(fixtures.EnvironmentVariable("AUTOPKGTEST_TMP", "1")) - - self.assertTrue(agent._is_ci_env()) - - def test_not_in_ci_env(self): - # unset any known testing environment vars - testing_vars = ["TRAVIS", "AUTHPKGTEST_TMP"] - vars_to_unset = [] - for env_var in os.environ: - for test_var in testing_vars: - if env_var.startswith(test_var): - vars_to_unset.append(env_var) - - for var in vars_to_unset: - self.useFixture(fixtures.EnvironmentVariable(var, None)) - - self.assertFalse(agent._is_ci_env()) diff --git a/tests/legacy/unit/store/v2/test_validation_sets.py b/tests/legacy/unit/store/v2/test_validation_sets.py index 2820efab48..81fa911c6f 100644 --- a/tests/legacy/unit/store/v2/test_validation_sets.py +++ b/tests/legacy/unit/store/v2/test_validation_sets.py @@ -26,6 +26,13 @@ def fake_snap_data(): "id": "snap-id", "presence": "required", "revision": 42, + "components": { + "component-with-revision": { + "presence": "required", + "revision": 10, + }, + "component-without-revision": "invalid", + }, } @@ -125,6 +132,13 @@ def test_editable_build_assertion_marshal_as_str(fake_editable_build_assertion): "name": "snap-name", "presence": "required", "revision": "42", + "components": { + "component-with-revision": { + "presence": "required", + "revision": "10", + }, + "component-without-revision": "invalid", + }, }, ], } @@ -147,6 +161,13 @@ def test_build_assertion_marshal_as_str(fake_build_assertion): "name": "snap-name", "presence": "required", "revision": "42", + "components": { + "component-with-revision": { + "presence": "required", + "revision": "10", + }, + "component-without-revision": "invalid", + }, }, ], "timestamp": "2020-10-29T16:36:56Z", diff --git a/tests/spread/core24/python-hello/poetry/snap/snapcraft.yaml b/tests/spread/core24/python-hello/poetry/snap/snapcraft.yaml new file mode 100644 index 0000000000..95d5a63e74 --- /dev/null +++ b/tests/spread/core24/python-hello/poetry/snap/snapcraft.yaml @@ -0,0 +1,14 @@ +name: python-hello-poetry +version: "1.0" +summary: simple python application +description: build a python application using core24 +base: core24 +confinement: strict + +apps: + python-hello-poetry: + command: bin/hello +parts: + hello: + plugin: poetry + source: src diff --git a/tests/spread/core24/python-hello/poetry/src/pyproject.toml b/tests/spread/core24/python-hello/poetry/src/pyproject.toml new file mode 100644 index 0000000000..eef363c29b --- /dev/null +++ b/tests/spread/core24/python-hello/poetry/src/pyproject.toml @@ -0,0 +1,18 @@ +[tool.poetry] +name = "hello" +version = "0.1.0" +description = "" +authors = ["Your Name "] + +[tool.poetry.dependencies] +python = "^3.10" +black = "^24.8.0" + +[tool.poetry.dev-dependencies] + +[build-system] +requires = ["poetry-core>=1.0.0"] +build-backend = "poetry.core.masonry.api" + +[tool.poetry.scripts] +hello = "hello:main" diff --git a/tests/spread/core24/python-hello/task.yaml b/tests/spread/core24/python-hello/task.yaml index 2db4043b9e..47a434462b 100644 --- a/tests/spread/core24/python-hello/task.yaml +++ b/tests/spread/core24/python-hello/task.yaml @@ -8,6 +8,7 @@ systems: environment: PARAM/strict: "" PARAM/classic: "--classic" + PARAM/poetry: "" restore: | cd ./"${SPREAD_VARIANT}" diff --git a/tests/spread/general/package-repositories/task.yaml b/tests/spread/general/package-repositories/task.yaml index 0c62af55b8..c7bfa0cb7f 100644 --- a/tests/spread/general/package-repositories/task.yaml +++ b/tests/spread/general/package-repositories/task.yaml @@ -30,12 +30,7 @@ execute: | cd "$SNAP" # Build what we have. - # We cannot use --use-lxd for autopkgtest so we resort to --destructive-mode there. - if [ "$SPREAD_SYSTEM" = "ubuntu-20.04-64" ]; then - snapcraft --use-lxd - else - snapcraft --destructive-mode - fi + snapcraft --use-lxd # And verify the snap runs as expected. snap install "${SNAP}"_1.0_*.snap --dangerous diff --git a/tests/spread/plugins/craft-parts/build-and-run-hello/poetry-hello/snap/snapcraft.yaml b/tests/spread/plugins/craft-parts/build-and-run-hello/poetry-hello/snap/snapcraft.yaml new file mode 100644 index 0000000000..b1d101bb25 --- /dev/null +++ b/tests/spread/plugins/craft-parts/build-and-run-hello/poetry-hello/snap/snapcraft.yaml @@ -0,0 +1,15 @@ +name: poetry-hello +version: "1.0" +summary: simple python application +description: build a python application using core22 +base: core22 +confinement: strict + +apps: + poetry-hello: + command: bin/hello + +parts: + hello: + plugin: poetry + source: src diff --git a/tests/spread/plugins/craft-parts/build-and-run-hello/poetry-hello/src/hello/__init__.py b/tests/spread/plugins/craft-parts/build-and-run-hello/poetry-hello/src/hello/__init__.py new file mode 100644 index 0000000000..e3095b2229 --- /dev/null +++ b/tests/spread/plugins/craft-parts/build-and-run-hello/poetry-hello/src/hello/__init__.py @@ -0,0 +1,2 @@ +def main(): + print("hello world") diff --git a/tests/spread/plugins/craft-parts/build-and-run-hello/poetry-hello/src/pyproject.toml b/tests/spread/plugins/craft-parts/build-and-run-hello/poetry-hello/src/pyproject.toml new file mode 100644 index 0000000000..eef363c29b --- /dev/null +++ b/tests/spread/plugins/craft-parts/build-and-run-hello/poetry-hello/src/pyproject.toml @@ -0,0 +1,18 @@ +[tool.poetry] +name = "hello" +version = "0.1.0" +description = "" +authors = ["Your Name "] + +[tool.poetry.dependencies] +python = "^3.10" +black = "^24.8.0" + +[tool.poetry.dev-dependencies] + +[build-system] +requires = ["poetry-core>=1.0.0"] +build-backend = "poetry.core.masonry.api" + +[tool.poetry.scripts] +hello = "hello:main" diff --git a/tests/spread/plugins/craft-parts/build-and-run-hello/task.yaml b/tests/spread/plugins/craft-parts/build-and-run-hello/task.yaml index bbb9bbea02..01b9eb9aa2 100644 --- a/tests/spread/plugins/craft-parts/build-and-run-hello/task.yaml +++ b/tests/spread/plugins/craft-parts/build-and-run-hello/task.yaml @@ -8,6 +8,7 @@ environment: SNAP/colcon_ros2_wrapper: colcon-ros2-wrapper SNAP/flutter: flutter-hello SNAP/python: python-hello + SNAP/poetry: poetry-hello SNAP/qmake: qmake-hello SNAP/maven: maven-hello SNAP/dotnet: dotnet-hello diff --git a/tests/spread/plugins/v2/colcon-ros2-daemon/task.yaml b/tests/spread/plugins/v2/colcon-ros2-daemon/task.yaml index e35c624bba..bb131dbbc8 100644 --- a/tests/spread/plugins/v2/colcon-ros2-daemon/task.yaml +++ b/tests/spread/plugins/v2/colcon-ros2-daemon/task.yaml @@ -1,5 +1,4 @@ summary: Build and run a basic daemon colcon snap -warn-timeout: 9m # Keep less than 10 minutes so Travis can't timeout priority: 100 # Run this test early so we're not waiting for it environment: diff --git a/tests/spread/store/registries/editor.sh b/tests/spread/store/registries/editor.sh new file mode 100755 index 0000000000..46b07515a4 --- /dev/null +++ b/tests/spread/store/registries/editor.sh @@ -0,0 +1,12 @@ +#! /bin/bash + +registries_file="$1" + +# flip-flop between 'access' being read and write +if grep -q "^ *access:.*read" "$registries_file"; then + access="write" +else + access="read" +fi + +sed -i "s/^\([[:space:]]*\)access:.*/\1access: $access/g" "$registries_file" diff --git a/tests/spread/store/registries/task.yaml b/tests/spread/store/registries/task.yaml new file mode 100644 index 0000000000..8441a863c2 --- /dev/null +++ b/tests/spread/store/registries/task.yaml @@ -0,0 +1,42 @@ +summary: test the registries commands + +environment: + SNAPCRAFT_ASSERTION_KEY: "$(HOST: echo ${SNAPCRAFT_ASSERTION_KEY})" + SNAPCRAFT_STORE_CREDENTIALS: "$(HOST: echo ${SNAPCRAFT_STORE_CREDENTIALS_STAGING})" + +prepare: | + if [[ -z "$SNAPCRAFT_STORE_CREDENTIALS" ]]; then + ERROR "No credentials set in env SNAPCRAFT_STORE_CREDENTIALS" + fi + + if [[ -z "$SNAPCRAFT_ASSERTION_KEY" ]]; then + ERROR "No gpg key set in env SNAPCRAFT_ASSERTION_KEY" + fi + + # setup snap gpg dir + mkdir -p "$HOME/.snap/gnupg" + chmod 700 "$HOME/.snap/gnupg" + + # import a registered key + gpg --homedir "$HOME/.snap/gnupg" --import <(echo "$SNAPCRAFT_ASSERTION_KEY" | base64 --decode) + + snap install yq + # registries only available in edge + snap refresh snapd --edge + +execute: | + # ensure snapcraft is logged in and can access the store + snapcraft whoami + + # snapcraft will use a fake file editor + export EDITOR="$PWD/editor.sh" + + snapcraft edit-registries "$(snapcraft whoami | yq .id)" testset --key-name testspreadkey + + snapcraft list-registries | MATCH testset + +restore: | + rm -rf "$HOME/.snap/gnupg" + + snap remove --purge yq + snap refresh snapd --stable diff --git a/tests/spread/store/validation-sets/editor.sh b/tests/spread/store/validation-sets/editor.sh index a38c96be47..eceab47d09 100755 --- a/tests/spread/store/validation-sets/editor.sh +++ b/tests/spread/store/validation-sets/editor.sh @@ -2,11 +2,11 @@ validation_set_file="$1" -# flip-flop between two valid revisions of `test-snapcraft-assertions` in the staging store: 1 and 2 -if grep -q "^ revision:.*1" "$validation_set_file"; then - (( revision=2 )) +# flip-flop between 'hello-world' being optional or required +if grep -q "^ presence:.*optional" "$validation_set_file"; then + presence="required" else - (( revision=1 )) + presence="optional" fi -sed -i "s/ revision:.*/ revision: $revision/g" "$validation_set_file" +sed -i "s/ presence:.*/ presence: $presence/g" "$validation_set_file" diff --git a/tests/spread/store/validation-sets/task.yaml b/tests/spread/store/validation-sets/task.yaml index 277ee9d8e1..599f01aad6 100644 --- a/tests/spread/store/validation-sets/task.yaml +++ b/tests/spread/store/validation-sets/task.yaml @@ -18,9 +18,7 @@ prepare: | chmod 700 "$HOME/.snap/gnupg" # import a registered key - echo "$SNAPCRAFT_ASSERTION_KEY" | base64 --decode > store-key.txt - gpg --homedir "$HOME/.snap/gnupg" --import store-key.txt - rm -f store-key.txt + gpg --homedir "$HOME/.snap/gnupg" --import <(echo "$SNAPCRAFT_ASSERTION_KEY" | base64 --decode) snap install yq diff --git a/tests/unit/commands/test_registries.py b/tests/unit/commands/test_registries.py index c4f34dac92..f206fe3866 100644 --- a/tests/unit/commands/test_registries.py +++ b/tests/unit/commands/test_registries.py @@ -53,7 +53,6 @@ def test_list_registries(mocker, mock_list_assertions, output_format, name): @pytest.mark.parametrize("name", [None, "test"]) def test_list_registries_default_format(mocker, mock_list_assertions, name): """Default format is 'table'.""" - """Test `snapcraft list-registries`.""" cmd = ["snapcraft", "list-registries"] if name: cmd.extend(["--name", name]) @@ -65,15 +64,18 @@ def test_list_registries_default_format(mocker, mock_list_assertions, name): mock_list_assertions.assert_called_once_with(name=name, output_format="table") +@pytest.mark.parametrize("key_name", [None, "test-key"]) @pytest.mark.usefixtures("memory_keyring") -def test_edit_registries(mocker, mock_edit_assertion): +def test_edit_registries(key_name, mocker, mock_edit_assertion): """Test `snapcraft edit-registries`.""" cmd = ["snapcraft", "edit-registries", "test-account-id", "test-name"] + if key_name: + cmd.extend(["--key-name", key_name]) mocker.patch.object(sys, "argv", cmd) app = application.create_app() app.run() mock_edit_assertion.assert_called_once_with( - name="test-name", account_id="test-account-id" + name="test-name", account_id="test-account-id", key_name=key_name ) diff --git a/tests/unit/commands/test_remote.py b/tests/unit/commands/test_remote.py index 6ebdc50633..c50abc9b21 100644 --- a/tests/unit/commands/test_remote.py +++ b/tests/unit/commands/test_remote.py @@ -22,7 +22,7 @@ import sys import time from pathlib import Path -from unittest.mock import ANY, Mock +from unittest.mock import ANY, Mock, call import pytest from craft_application import launchpad @@ -1019,9 +1019,13 @@ def test_monitor_build_error(mocker, emitter, snapcraft_yaml, base, fake_service @pytest.mark.parametrize("base", const.CURRENT_BASES) -@pytest.mark.usefixtures("mock_confirm") -def test_monitor_build_interrupt(mocker, emitter, snapcraft_yaml, base, fake_services): +@pytest.mark.parametrize("cleanup", [True, False]) +def test_monitor_build_interrupt( + cleanup, mock_confirm, mocker, emitter, snapcraft_yaml, base, fake_services +): """Test the monitor_build cleanup when a keyboard interrupt occurs.""" + # first prompt is for public upload, second is to cancel builds + mock_confirm.side_effect = [True, cleanup] mocker.patch.object(sys, "argv", ["snapcraft", "remote-build"]) snapcraft_yaml_dict = {"base": base, "build-base": "devel", "grade": "devel"} snapcraft_yaml(**snapcraft_yaml_dict) @@ -1043,6 +1047,10 @@ def test_monitor_build_interrupt(mocker, emitter, snapcraft_yaml, base, fake_ser "craft_application.services.remotebuild.RemoteBuildService.cleanup" ) + mock_cancel_builds = mocker.patch( + "craft_application.services.remotebuild.RemoteBuildService.cancel_builds" + ) + app = application.create_app() app.services.remote_build._name = get_build_id( app.services.app.name, app.project.name, app.project_dir @@ -1050,15 +1058,24 @@ def test_monitor_build_interrupt(mocker, emitter, snapcraft_yaml, base, fake_ser app.services.remote_build._is_setup = True app.services.remote_build.request.download_files_with_progress = Mock() - assert app.run() == 0 + assert app.run() == os.EX_OK mock_start_builds.assert_called_once() mock_monitor_builds.assert_called_once() mock_fetch_logs.assert_not_called() - mock_cleanup.assert_called_once() - emitter.assert_progress("Cancelling builds.") - emitter.assert_progress("Cleaning up") + cancel_emitted = call("progress", "Cancelling builds.") in emitter.interactions + clean_emitted = call("progress", "Cleaning up.") in emitter.interactions + if cleanup: + mock_cancel_builds.assert_called_once() + assert cancel_emitted + mock_cleanup.assert_called_once() + assert clean_emitted + else: + mock_cancel_builds.assert_not_called() + assert not cancel_emitted + mock_cleanup.assert_not_called() + assert not clean_emitted @pytest.mark.parametrize("base", const.CURRENT_BASES) @@ -1091,7 +1108,7 @@ def test_monitor_build_timeout(mocker, emitter, snapcraft_yaml, base, fake_servi app.services.app.name, app.project.name, app.project_dir ) - assert app.run() == 75 + assert app.run() == os.EX_TEMPFAIL mock_start_builds.assert_called_once() mock_monitor_builds.assert_called_once() diff --git a/tests/unit/commands/test_validation_sets.py b/tests/unit/commands/test_validation_sets.py index 1e69a278d1..0deefb31ee 100644 --- a/tests/unit/commands/test_validation_sets.py +++ b/tests/unit/commands/test_validation_sets.py @@ -54,6 +54,28 @@ "id": "XXSnapIDForXSnapName2XXXXXXXXXXX", "name": "snap-name-2", }, + { + "id": "XXSnapIDForXSnapName3XXXXXXXXXXX", + "name": "snap-name-3", + "presence": "optional", + "revision": "1", + "components": { + "comp-name-1": { + "presence": "required", + "revision": "11", + }, + }, + }, + { + "id": "XXSnapIDForXSnapName4XXXXXXXXXXX", + "name": "snap-name-4", + "presence": "optional", + "components": { + "comp-name-1": "required", + "comp-name-2": "optional", + "comp-name-3": "invalid", + }, + }, ], "timestamp": "2020-10-29T16:36:56Z", "type": "validation-set", @@ -125,6 +147,28 @@ def edit_return_value(): "revision": "10", }, {"id": "XXSnapIDForXSnapName2XXXXXXXXXXX", "name": "snap-name-2"}, + { + "id": "XXSnapIDForXSnapName3XXXXXXXXXXX", + "name": "snap-name-3", + "presence": "optional", + "revision": "1", + "components": { + "comp-name-1": { + "presence": "required", + "revision": "11", + }, + }, + }, + { + "id": "XXSnapIDForXSnapName4XXXXXXXXXXX", + "name": "snap-name-4", + "presence": "optional", + "components": { + "comp-name-1": "required", + "comp-name-2": "optional", + "comp-name-3": "invalid", + }, + }, ], } ) @@ -157,6 +201,28 @@ def fake_edit_validation_sets(mocker, edit_return_value): "revision": 10, }, {"name": "snap-name-2", "id": "XXSnapIDForXSnapName2XXXXXXXXXXX"}, + { + "id": "XXSnapIDForXSnapName3XXXXXXXXXXX", + "name": "snap-name-3", + "presence": "optional", + "revision": 1, + "components": { + "comp-name-1": { + "presence": "required", + "revision": 11, + }, + }, + }, + { + "id": "XXSnapIDForXSnapName4XXXXXXXXXXX", + "name": "snap-name-4", + "presence": "optional", + "components": { + "comp-name-1": "required", + "comp-name-2": "optional", + "comp-name-3": "invalid", + }, + }, ], } ) @@ -165,7 +231,9 @@ def fake_edit_validation_sets(mocker, edit_return_value): '{{"account-id": "AccountIDXXXOfTheRequestingUserX", "name": "certification-x1", ' '"revision": "222", "sequence": "9", "snaps": [{{"name": "snap-name-1", "id": ' '"XXSnapIDForXSnapName1XXXXXXXXXXX", "presence": "optional", "revision": "10"}}, ' - '{{"name": "snap-name-2", "id": "XXSnapIDForXSnapName2XXXXXXXXXXX"}}], ' + '{{"name": "snap-name-2", "id": "XXSnapIDForXSnapName2XXXXXXXXXXX"}}, ' + '{{"name": "snap-name-3", "id": "XXSnapIDForXSnapName3XXXXXXXXXXX", "presence": "optional", "revision": "1", "components": {{"comp-name-1": {{"presence": "required", "revision": "11"}}}}}}, ' + '{{"name": "snap-name-4", "id": "XXSnapIDForXSnapName4XXXXXXXXXXX", "presence": "optional", "components": {{"comp-name-1": "required", "comp-name-2": "optional", "comp-name-3": "invalid"}}}}], ' '"authority-id": "AccountIDXXXOfTheRequestingUserX", "series": "16", "timestamp": ' '"2020-10-29T16:36:56Z", "type": "validation-set"}}\n\nSIGNED{key_name}' ) diff --git a/tests/unit/linters/test_linters.py b/tests/unit/linters/test_linters.py index cf2adec6b7..7e9c87d3d3 100644 --- a/tests/unit/linters/test_linters.py +++ b/tests/unit/linters/test_linters.py @@ -256,8 +256,8 @@ def test_base_linter_is_file_ignored(): # The "test-path" Path must be ignored by the "main" filter and all categories. assert linter.is_file_ignored(Path("test-path")) - assert linter.is_file_ignored(Path("test-path", category="test-1")) - assert linter.is_file_ignored(Path("test-path", category="test-2")) + assert linter.is_file_ignored(Path("test-path"), category="test-1") + assert linter.is_file_ignored(Path("test-path"), category="test-2") # "test-1-path" is ignored by the "test-1" only assert not linter.is_file_ignored(Path("test-1-path")) diff --git a/tests/unit/models/test_assertions.py b/tests/unit/models/test_assertions.py index a6fed23d95..16c6552347 100644 --- a/tests/unit/models/test_assertions.py +++ b/tests/unit/models/test_assertions.py @@ -17,7 +17,42 @@ """Tests for Assertion models.""" +import pytest + from snapcraft.models import EditableRegistryAssertion, Registry, RegistryAssertion +from snapcraft.models.assertions import cast_dict_scalars_to_strings + + +@pytest.mark.parametrize( + ("input_dict", "expected_dict"), + [ + pytest.param({}, {}, id="empty"), + pytest.param( + {False: False, True: True}, + {"False": "False", "True": "True"}, + id="boolean values", + ), + pytest.param( + {0: 0, None: None, "dict": {}, "list": [], "str": ""}, + ({"0": "0", None: None, "dict": {}, "list": [], "str": ""}), + id="none-like values", + ), + pytest.param( + {10: 10, 20.0: 20.0, "30": "30", True: True}, + {"10": "10", "20.0": "20.0", "30": "30", "True": "True"}, + id="scalar values", + ), + pytest.param( + {"foo": {"bar": [1, 2.0], "baz": {"qux": True}}}, + {"foo": {"bar": ["1", "2.0"], "baz": {"qux": "True"}}}, + id="nested data structures", + ), + ], +) +def test_cast_dict_scalars_to_strings(input_dict, expected_dict): + actual = cast_dict_scalars_to_strings(input_dict) + + assert actual == expected_dict def test_registry_defaults(check): @@ -73,11 +108,34 @@ def test_editable_registry_assertion_defaults(check): } ) - check.is_none(assertion.summary) check.equal(assertion.revision, 0) check.is_none(assertion.body) +def test_editable_registry_assertion_marshal_as_str(): + """Cast all scalars to string when marshalling.""" + assertion = EditableRegistryAssertion.unmarshal( + { + "account_id": "test-account-id", + "name": "test-registry", + "revision": 10, + "views": { + "wifi-setup": { + "rules": [ + { + "storage": "wifi.ssids", + } + ] + } + }, + } + ) + + assertion_dict = assertion.marshal_scalars_as_strings() + + assert assertion_dict["revision"] == "10" + + def test_registry_assertion_defaults(check): """Test default values of the RegistryAssertion model.""" assertion = RegistryAssertion.unmarshal( @@ -104,5 +162,31 @@ def test_registry_assertion_defaults(check): check.is_none(assertion.body) check.is_none(assertion.body_length) check.is_none(assertion.sign_key_sha3_384) - check.is_none(assertion.summary) check.equal(assertion.revision, 0) + + +def test_registry_assertion_marshal_as_str(): + """Cast all scalars to strings when marshalling.""" + assertion = RegistryAssertion.unmarshal( + { + "account_id": "test-account-id", + "authority_id": "test-authority-id", + "name": "test-registry", + "revision": 10, + "timestamp": "2024-01-01T10:20:30Z", + "type": "registry", + "views": { + "wifi-setup": { + "rules": [ + { + "storage": "wifi.ssids", + } + ] + } + }, + } + ) + + assertion_dict = assertion.marshal_scalars_as_strings() + + assert assertion_dict["revision"] == "10" diff --git a/tests/unit/parts/plugins/test_python_plugin.py b/tests/unit/parts/plugins/test_python_plugin.py index d41f6d295a..6a618bd788 100644 --- a/tests/unit/parts/plugins/test_python_plugin.py +++ b/tests/unit/parts/plugins/test_python_plugin.py @@ -19,7 +19,7 @@ import pytest from craft_parts import Part, PartInfo, ProjectInfo, Step, StepInfo, errors -from snapcraft.parts.plugins import PythonPlugin +from snapcraft.parts.plugins import PythonPlugin, python_common @pytest.fixture @@ -66,7 +66,7 @@ def test_get_build_commands(plugin, new_dir): f'PARTS_PYTHON_VENV_INTERP_PATH="{new_dir}/parts/my-part/install/bin/${{PARTS_PYTHON_INTERPRETER}}"', f"{new_dir}/parts/my-part/install/bin/pip install -U pip setuptools wheel", f"[ -f setup.py ] || [ -f pyproject.toml ] && {new_dir}/parts/my-part/install/bin/pip install -U .", - f'find "{new_dir}/parts/my-part/install" -type f -executable -print0 | xargs -0 \\\n' + f'find "{new_dir}/parts/my-part/install" -type f -executable -print0 | xargs --no-run-if-empty -0 \\\n' ' sed -i "1 s|^#\\!${PARTS_PYTHON_VENV_INTERP_PATH}.*$|#!/usr/bin/env ${PARTS_PYTHON_INTERPRETER}|"\n', dedent( f"""\ @@ -224,7 +224,7 @@ def test_fix_pyvenv(new_dir, home_attr): step_info = StepInfo(part_info, Step.PRIME) - PythonPlugin.post_prime(step_info) + python_common.post_prime(step_info) new_contents = pyvenv.read_text() assert "home = /snap/test-snap/current/usr/bin" in new_contents diff --git a/tests/unit/services/test_assertions.py b/tests/unit/services/test_assertions.py index 73b15bc92e..56da17d207 100644 --- a/tests/unit/services/test_assertions.py +++ b/tests/unit/services/test_assertions.py @@ -16,15 +16,19 @@ """Tests for the abstract assertions service.""" +import json +import tempfile import textwrap from typing import Any from unittest import mock +import craft_store.errors import pytest from craft_application.models import CraftBaseModel from typing_extensions import override from snapcraft import const, errors +from tests.unit.store.utils import FakeResponse @pytest.fixture(autouse=True) @@ -48,8 +52,8 @@ def mock_confirm_with_user(mocker, request): @pytest.fixture -def mock_subprocess_run(mocker, tmp_path, request): - """Mock the subprocess.run function to write data to a file. +def write_text(mocker, tmp_path, request): + """Mock the subprocess.run function to write fake data to a temp assertion file. :param request: A list of strings to write to a file. Each time the subprocess.run function is called, the last string in the list will be written to the file @@ -65,12 +69,49 @@ def side_effect(*args, **kwargs): return subprocess_mock +@pytest.fixture +def fake_sign_assertion(mocker): + def _fake_sign(cmdline, input): # noqa: A002 (builtin-argument-shadowing) + return input + b"-signed" + + mock_subprocess = mocker.patch("subprocess.check_output") + mock_subprocess.side_effect = _fake_sign + return mock_subprocess + + +@pytest.fixture(autouse=True) +def mock_named_temporary_file(mocker, tmp_path): + _mock_tempfile = mocker.patch( + "tempfile.NamedTemporaryFile", spec=tempfile.NamedTemporaryFile + ) + _mock_tempfile.return_value.__enter__.return_value.name = str( + tmp_path / "assertion-file" + ) + yield _mock_tempfile.return_value + + +FAKE_STORE_ERROR = craft_store.errors.StoreServerError( + response=FakeResponse( + content=json.dumps( + {"error_list": [{"code": "bad assertion", "message": "bad assertion"}]} + ), + status_code=400, + ) +) + + class FakeAssertion(CraftBaseModel): """Fake assertion model.""" test_field_1: str test_field_2: int + def marshal_scalars_as_strings(self): + return { + "test_field_1": self.test_field_1, + "test_field_2": str(self.test_field_2), + } + @pytest.fixture def fake_assertion_service(default_factory): @@ -99,6 +140,21 @@ def _get_assertions( # type: ignore[override] FakeAssertion(test_field_1="test-value-2", test_field_2=100), ] + @override + def _build_assertion( # type: ignore[override] + self, assertion: FakeAssertion + ) -> FakeAssertion: + assertion.test_field_1 = assertion.test_field_1 + "-built" + return assertion + + @override + def _post_assertion( # type: ignore[override] + self, assertion_data: bytes + ) -> FakeAssertion: + return FakeAssertion( + test_field_1="test-published-assertion", test_field_2=0 + ) + @override def _normalize_assertions( # type: ignore[override] self, assertions: list[FakeAssertion] @@ -133,19 +189,13 @@ def _generate_yaml_from_template(self, name: str, account_id: str) -> str: """ ) - return FakeAssertionService(app=APP_METADATA, services=default_factory) - + @override + def _get_success_message( # type: ignore[override] + self, assertion: FakeAssertion + ) -> str: + return "Success." -@pytest.fixture -def fake_edit_yaml_file(mocker, fake_assertion_service): - """Apply a fake edit to a yaml file.""" - return mocker.patch.object( - fake_assertion_service, - "_edit_yaml_file", - return_value=FakeAssertion( - test_field_1="test-value-1-UPDATED", test_field_2=999 - ), - ) + return FakeAssertionService(app=APP_METADATA, services=default_factory) def test_list_assertions_table(fake_assertion_service, emitter): @@ -199,62 +249,213 @@ def test_list_assertions_unknown_format(fake_assertion_service): ) +@pytest.mark.parametrize( + "write_text", + [["test-field-1: test-value-1-edited\ntest-field-2: 999"]], + indirect=True, +) +@pytest.mark.usefixtures("fake_sign_assertion") def test_edit_assertions_changes_made( - fake_edit_yaml_file, fake_assertion_service, emitter + fake_assertion_service, + emitter, + mocker, + tmp_path, + write_text, ): """Edit an assertion and make a valid change.""" - expected = "Building, signing and uploading fake assertion is not implemented" - fake_assertion_service.setup() + expected_assertion = ( + b'{"test_field_1": "test-value-1-edited-built", "test_field_2": "999"}-signed' + ) + mock_post_assertion = mocker.spy(fake_assertion_service, "_post_assertion") - with pytest.raises(errors.FeatureNotImplemented, match=expected): - fake_assertion_service.edit_assertion( - name="test-registry", account_id="test-account-id" - ) + fake_assertion_service.setup() + fake_assertion_service.edit_assertion( + name="test-registry", account_id="test-account-id", key_name="test-key" + ) - emitter.assert_message("Successfully edited fake assertion 'test-registry'.") + mock_post_assertion.assert_called_once_with(expected_assertion) + emitter.assert_trace(f"Signed assertion: {expected_assertion.decode()}") + emitter.assert_message("Success.") +@pytest.mark.parametrize( + "write_text", + [["test-field-1: test-value-1\ntest-field-2: 0"]], + indirect=True, +) def test_edit_assertions_no_changes_made( - fake_edit_yaml_file, fake_assertion_service, emitter, mocker + fake_assertion_service, emitter, tmp_path, write_text ): """Edit an assertion but make no changes to the data.""" + fake_assertion_service.setup() + fake_assertion_service.edit_assertion( + name="test-registry", account_id="test-account-id" + ) + + emitter.assert_message("No changes made.") + assert not (tmp_path / "assertion-file").exists() + + +@pytest.mark.parametrize( + "write_text", + [ + [ + "test-field-1: test-value-1-edited-edited\ntest-field-2: 999", + "test-field-1: test-value-1-edited\ntest-field-2: 999", + ], + ], + indirect=True, +) +@pytest.mark.parametrize("mock_confirm_with_user", [True], indirect=True) +@pytest.mark.parametrize( + "error", [FAKE_STORE_ERROR, errors.SnapcraftAssertionError("bad assertion")] +) +@pytest.mark.usefixtures("fake_sign_assertion") +def test_edit_assertions_build_assertion_error( + error, + fake_assertion_service, + emitter, + mock_confirm_with_user, + write_text, + mocker, + tmp_path, +): + """Receive an error while building an assertion, then re-edit and post the assertion.""" + expected_assertion = b'{"test_field_1": "test-value-1-edited-edited-built", "test_field_2": "999"}-signed' + mock_post_assertion = mocker.spy(fake_assertion_service, "_post_assertion") mocker.patch.object( fake_assertion_service, - "_edit_yaml_file", - # make no changes to the fake assertion - return_value=FakeAssertion(test_field_1="test-value-1", test_field_2=0), + "_build_assertion", + side_effect=[ + error, + FakeAssertion( + test_field_1="test-value-1-edited-edited-built", test_field_2=999 + ), + ], ) + fake_assertion_service.setup() + fake_assertion_service.edit_assertion( + name="test-registry", account_id="test-account-id", key_name="test-key" + ) + assert mock_confirm_with_user.mock_calls == [ + mock.call("Do you wish to amend the fake assertion?") + ] + assert mock_post_assertion.mock_calls == [mock.call(expected_assertion)] + emitter.assert_trace(f"Signed assertion: {expected_assertion.decode()}") + emitter.assert_message("Success.") + assert not (tmp_path / "assertion-file").exists() + + +@pytest.mark.parametrize( + "write_text", + [ + [ + "test-field-1: test-value-1-edited-edited\ntest-field-2: 999", + "test-field-1: test-value-1-edited\ntest-field-2: 999", + ], + ], + indirect=True, +) +@pytest.mark.parametrize("mock_confirm_with_user", [True], indirect=True) +@pytest.mark.usefixtures("fake_sign_assertion") +def test_edit_assertions_sign_assertion_error( + fake_assertion_service, + emitter, + mock_confirm_with_user, + write_text, + mocker, + tmp_path, +): + """Receive an error while signing an assertion, then re-edit and post the assertion.""" + expected_assertion = b'{"test_field_1": "test-value-1-edited-edited-built", "test_field_2": "999"}-signed' + mock_post_assertion = mocker.spy(fake_assertion_service, "_post_assertion") + mocker.patch.object( + fake_assertion_service, + "_sign_assertion", + side_effect=[ + errors.SnapcraftAssertionError("bad assertion"), + expected_assertion, + ], + ) + + fake_assertion_service.setup() fake_assertion_service.edit_assertion( - name="test-registry", account_id="test-account-id" + name="test-registry", account_id="test-account-id", key_name="test-key" ) - emitter.assert_message("No changes made.") + assert mock_confirm_with_user.mock_calls == [ + mock.call("Do you wish to amend the fake assertion?") + ] + assert mock_post_assertion.mock_calls == [mock.call(expected_assertion)] + emitter.assert_message("Success.") + assert not (tmp_path / "assertion-file").exists() -@pytest.mark.parametrize("editor", [None, "faux-vi"]) @pytest.mark.parametrize( - "mock_subprocess_run", + "write_text", [ [ - textwrap.dedent( - """\ - test-field-1: test-value-1-UPDATED - test-field-2: 999 - """ - ), + "test-field-1: test-value-1-edited-edited\ntest-field-2: 999", + "test-field-1: test-value-1-edited\ntest-field-2: 999", ], ], indirect=True, ) @pytest.mark.parametrize("mock_confirm_with_user", [True], indirect=True) +@pytest.mark.parametrize( + "error", [FAKE_STORE_ERROR, errors.SnapcraftAssertionError("bad assertion")] +) +@pytest.mark.usefixtures("fake_sign_assertion") +def test_edit_assertions_post_assertion_error( + error, + fake_assertion_service, + emitter, + mock_confirm_with_user, + write_text, + mocker, + tmp_path, +): + """Receive an error while processing an assertion, then re-edit and post the assertion.""" + expected_first_assertion = ( + b'{"test_field_1": "test-value-1-edited-built", "test_field_2": "999"}-signed' + ) + expected_second_assertion = b'{"test_field_1": "test-value-1-edited-edited-built", "test_field_2": "999"}-signed' + mock_post_assertion = mocker.patch.object( + fake_assertion_service, "_post_assertion", side_effect=[error, None] + ) + + fake_assertion_service.setup() + fake_assertion_service.edit_assertion( + name="test-registry", account_id="test-account-id", key_name="test-key" + ) + + assert mock_confirm_with_user.mock_calls == [ + mock.call("Do you wish to amend the fake assertion?") + ] + assert mock_post_assertion.mock_calls == [ + mock.call(expected_first_assertion), + mock.call(expected_second_assertion), + ] + emitter.assert_trace(f"Signed assertion: {expected_second_assertion.decode()}") + emitter.assert_message("Success.") + assert not (tmp_path / "assertion-file").exists() + + +@pytest.mark.parametrize("editor", [None, "faux-vi"]) +@pytest.mark.parametrize( + "write_text", + [["test-field-1: test-value-1-edited\ntest-field-2: 999"]], + indirect=True, +) +@pytest.mark.parametrize("mock_confirm_with_user", [True], indirect=True) def test_edit_yaml_file( editor, fake_assertion_service, tmp_path, mock_confirm_with_user, - mock_subprocess_run, + write_text, monkeypatch, ): """Successfully edit a yaml file with the correct editor.""" @@ -271,50 +472,26 @@ def test_edit_yaml_file( edited_assertion = fake_assertion_service._edit_yaml_file(tmp_file) assert edited_assertion == FakeAssertion( - test_field_1="test-value-1-UPDATED", test_field_2=999 + test_field_1="test-value-1-edited", test_field_2=999 ) mock_confirm_with_user.assert_not_called() - assert mock_subprocess_run.mock_calls == [ - mock.call([expected_editor, tmp_file], check=True) - ] + assert write_text.mock_calls == [mock.call([expected_editor, tmp_file], check=True)] @pytest.mark.parametrize( - "mock_subprocess_run", + "write_text", [ pytest.param( [ - textwrap.dedent( - """\ - test-field-1: test-value-1-UPDATED - test-field-2: 999 - """ - ), - textwrap.dedent( - """\ - bad yaml {{ - test-field-1: test-value-1 - test-field-2: 0 - """ - ), + "test-field-1: test-value-1-edited\ntest-field-2: 999", + "bad yaml {{\ntest-field-1: test-value-1\ntest-field-2: 0", ], id="invalid yaml syntax", ), pytest.param( [ - textwrap.dedent( - """\ - test-field-1: test-value-1-UPDATED - test-field-2: 999 - """ - ), - textwrap.dedent( - """\ - extra-field: not-allowed - test-field-1: [wrong data type] - test-field-2: 0 - """ - ), + "test-field-1: test-value-1-edited\ntest-field-2: 999", + "extra-field: not-allowed\ntest-field-1: [wrong data type]\ntest-field-2: 0", ], id="invalid pydantic data", ), @@ -326,7 +503,7 @@ def test_edit_yaml_file_error_retry( fake_assertion_service, tmp_path, mock_confirm_with_user, - mock_subprocess_run, + write_text, ): """Edit a yaml file but encounter an error and retry.""" tmp_file = tmp_path / "assertion-file" @@ -335,30 +512,17 @@ def test_edit_yaml_file_error_retry( edited_assertion = fake_assertion_service._edit_yaml_file(tmp_file) assert edited_assertion == FakeAssertion( - test_field_1="test-value-1-UPDATED", test_field_2=999 + test_field_1="test-value-1-edited", test_field_2=999 ) assert mock_confirm_with_user.mock_calls == [ mock.call("Do you wish to amend the fake assertion?") ] - assert ( - mock_subprocess_run.mock_calls - == [mock.call(["faux-vi", tmp_file], check=True)] * 2 - ) + assert write_text.mock_calls == [mock.call(["faux-vi", tmp_file], check=True)] * 2 @pytest.mark.parametrize( - "mock_subprocess_run", - [ - [ - textwrap.dedent( - """\ - bad yaml {{ - test-field-1: test-value-1 - test-field-2: 0 - """ - ), - ], - ], + "write_text", + [["bad yaml {{\ntest-field-1: test-value-1\ntest-field-2: 0"]], indirect=True, ) @pytest.mark.parametrize("mock_confirm_with_user", [False], indirect=True) @@ -366,7 +530,7 @@ def test_edit_error_no_retry( fake_assertion_service, tmp_path, mock_confirm_with_user, - mock_subprocess_run, + write_text, ): """Edit a yaml file and encounter an error but do not retry.""" tmp_file = tmp_path / "assertion-file" @@ -378,6 +542,4 @@ def test_edit_error_no_retry( assert mock_confirm_with_user.mock_calls == [ mock.call("Do you wish to amend the fake assertion?") ] - assert mock_subprocess_run.mock_calls == [ - mock.call(["faux-vi", tmp_file], check=True) - ] + assert write_text.mock_calls == [mock.call(["faux-vi", tmp_file], check=True)] diff --git a/tests/unit/services/test_package.py b/tests/unit/services/test_package.py index 57949bd4f8..9590130d01 100644 --- a/tests/unit/services/test_package.py +++ b/tests/unit/services/test_package.py @@ -76,7 +76,7 @@ def test_metadata( ): project_path = new_dir / "snapcraft.yaml" snapcraft_yaml(filename=project_path) - default_factory.set_kwargs( + default_factory.update_kwargs( "lifecycle", work_dir=Path("work"), cache_dir=new_dir, @@ -122,7 +122,7 @@ def test_write_metadata( default_build_plan, new_dir, ): - default_factory.set_kwargs( + default_factory.update_kwargs( "lifecycle", work_dir=Path("work"), cache_dir=new_dir, @@ -163,7 +163,7 @@ def test_write_metadata_with_manifest( new_dir, ): monkeypatch.setenv("SNAPCRAFT_BUILD_INFO", "1") - default_factory.set_kwargs( + default_factory.update_kwargs( "lifecycle", work_dir=Path("work"), cache_dir=new_dir, @@ -180,7 +180,7 @@ def test_write_metadata_with_manifest( # This will be different every time due to started_at differing, we can check # that it's a valid manifest and compare some fields to snap.yaml. manifest_dict = yaml.safe_load((prime_dir / "snap" / "manifest.yaml").read_text()) - manifest = models.Manifest.parse_obj(manifest_dict) + manifest = models.Manifest.model_validate(manifest_dict) assert manifest.snapcraft_version == __version__ assert ( @@ -208,7 +208,7 @@ def test_write_metadata_with_project_hooks( shutil.move(new_dir / "snap" / "snapcraft.yaml", new_dir) shutil.rmtree(new_dir / "snap") - default_factory.set_kwargs( + default_factory.update_kwargs( "lifecycle", work_dir=work_dir, cache_dir=new_dir, @@ -257,7 +257,7 @@ def test_write_metadata_with_built_hooks( new_dir, ): work_dir = new_dir / "work" - default_factory.set_kwargs( + default_factory.update_kwargs( "lifecycle", work_dir=work_dir, cache_dir=new_dir, @@ -307,7 +307,7 @@ def test_write_metadata_with_project_gui( new_dir, ): work_dir = new_dir / "work" - default_factory.set_kwargs( + default_factory.update_kwargs( "lifecycle", work_dir=work_dir, cache_dir=new_dir, @@ -367,7 +367,7 @@ def test_update_project_parse_info( ): work_dir = Path("work").resolve() - default_factory.set_kwargs( + default_factory.update_kwargs( "lifecycle", work_dir=work_dir, cache_dir=new_dir, diff --git a/tests/unit/services/test_registries.py b/tests/unit/services/test_registries.py index f791cceb9a..2305f13413 100644 --- a/tests/unit/services/test_registries.py +++ b/tests/unit/services/test_registries.py @@ -17,8 +17,9 @@ """Tests for the registries service.""" import textwrap +from unittest import mock -from snapcraft.models import EditableRegistryAssertion +from snapcraft.models import EditableRegistryAssertion, RegistryAssertion def test_registries_service_type(registries_service): @@ -37,6 +38,24 @@ def test_get_assertions(registries_service): ) +def test_build_assertion(registries_service): + mock_assertion = mock.Mock(spec=RegistryAssertion) + + registries_service._build_assertion(mock_assertion) + + registries_service._store_client.build_registries.assert_called_once_with( + registries=mock_assertion + ) + + +def test_post_assertions(registries_service): + registries_service._post_assertion(b"test-assertion-data") + + registries_service._store_client.post_registries.assert_called_once_with( + registries_data=b"test-assertion-data" + ) + + def test_normalize_assertions_empty(registries_service, check): headers, registries = registries_service._normalize_assertions([]) @@ -71,7 +90,6 @@ def test_normalize_assertions(fake_registry_assertion, registries_service, check def test_generate_yaml_from_model(fake_registry_assertion, registries_service): assertion = fake_registry_assertion( - summary="test-summary", revision="10", views={ "wifi-setup": { @@ -102,7 +120,6 @@ def test_generate_yaml_from_model(fake_registry_assertion, registries_service): """\ account-id: test-account-id name: test-registry - # summary: test-summary # The revision for this registries set # revision: 10 views: @@ -129,3 +146,11 @@ def test_generate_yaml_from_model(fake_registry_assertion, registries_service): """ ) + + +def test_get_success_message(fake_registry_assertion, registries_service): + message = registries_service._get_success_message( + fake_registry_assertion(revision=10) + ) + + assert message == "Successfully created revision 10 for 'test-registry'." diff --git a/tests/unit/store/test_client.py b/tests/unit/store/test_client.py index 8a41d82fce..6fc14ae9f0 100644 --- a/tests/unit/store/test_client.py +++ b/tests/unit/store/test_client.py @@ -17,7 +17,7 @@ import json import textwrap import time -from unittest.mock import ANY, call +from unittest.mock import ANY, Mock, call import craft_store import pytest @@ -180,7 +180,7 @@ def list_registries_payload(): "account-id": "test-account-id", "authority-id": "test-authority-id", "body-length": "92", - "name": "test-registry", + "name": "test-registries", "revision": "9", "sign-key-sha3-384": "test-sign-key", "timestamp": "2024-01-01T10:20:30Z", @@ -203,6 +203,62 @@ def list_registries_payload(): } +@pytest.fixture +def build_registries_payload(): + return { + "account_id": "test-account-id", + "authority_id": "test-authority-id", + "name": "test-registries", + "revision": "10", + "views": { + "wifi-setup": { + "rules": [ + { + "request": "ssids", + "storage": "wifi.ssids", + "access": "read-write", + } + ] + } + }, + "body": '{\n "storage": {\n "schema": {\n "wifi": {\n "values": "any"\n }\n }\n }\n}', + "type": "registry", + "timestamp": "2024-01-01T10:20:30Z", + } + + +@pytest.fixture +def post_registries_payload(): + return { + "assertions": [ + { + "headers": { + "account-id": "test-account-id", + "authority-id": "test-authority-id", + "body-length": "92", + "name": "test-registries", + "revision": "10", + "sign-key-sha3-384": "test-key", + "timestamp": "2024-01-01T10:20:30Z", + "type": "registry", + "views": { + "wifi-setup": { + "rules": [ + { + "access": "read", + "request": "ssids", + "storage": "wifi.ssids", + } + ] + } + }, + }, + "body": '{\n "storage": {\n "schema": {\n "wifi": {\n "values": "any"\n }\n }\n }\n}', + } + ] + } + + #################### # User Agent Tests # #################### @@ -219,30 +275,6 @@ def test_useragent_linux(): ) -@pytest.mark.parametrize("testing_env", ("TRAVIS_TESTING", "AUTOPKGTEST_TMP")) -def test_useragent_linux_with_testing(monkeypatch, testing_env): - """Construct a user-agent as a patched Linux machine""" - monkeypatch.setenv(testing_env, "1") - os_platform = OSPlatform( - system="Arch Linux", release="5.10.10-arch1-1", machine="x86_64" - ) - - assert client.build_user_agent(version="7.1.0", os_platform=os_platform) == ( - "snapcraft/7.1.0 (testing) Arch Linux/5.10.10-arch1-1 (x86_64)" - ) - - -@pytest.mark.parametrize("testing_env", ("TRAVIS_TESTING", "AUTOPKGTEST_TMP")) -def test_useragent_windows_with_testing(monkeypatch, testing_env): - """Construct a user-agent as a patched Windows machine""" - monkeypatch.setenv(testing_env, "1") - os_platform = OSPlatform(system="Windows", release="10", machine="AMD64") - - assert client.build_user_agent(version="7.1.0", os_platform=os_platform) == ( - "snapcraft/7.1.0 (testing) Windows/10 (AMD64)" - ) - - ##################### # Store Environment # ##################### @@ -1091,7 +1123,7 @@ def test_list_revisions(fake_client, list_revisions_payload): @pytest.mark.parametrize("name", [None, "test-registry"]) def test_list_registries(name, fake_client, list_registries_payload, check): - """Test the registries endpoint.""" + """Test the list registries endpoint.""" fake_client.request.return_value = FakeResponse( status_code=200, content=json.dumps(list_registries_payload).encode() ) @@ -1122,7 +1154,7 @@ def test_list_registries(name, fake_client, list_registries_payload, check): def test_list_registries_empty(fake_client, check): - """Test the registries endpoint with no registries returned.""" + """Test the list registries endpoint with no registries returned.""" fake_client.request.return_value = FakeResponse( status_code=200, content=json.dumps({"assertions": []}).encode() ) @@ -1145,6 +1177,140 @@ def test_list_registries_empty(fake_client, check): ) +def test_list_registries_unmarshal_error(fake_client, list_registries_payload): + """Raise an error if the response cannot be unmarshalled.""" + list_registries_payload["assertions"][0]["headers"].pop("name") + fake_client.request.return_value = FakeResponse( + status_code=200, content=json.dumps(list_registries_payload).encode() + ) + + with pytest.raises(errors.SnapcraftAssertionError) as raised: + client.StoreClientCLI().list_registries() + + assert str(raised.value) == "Received invalid registries set from the store" + assert raised.value.details == ( + "Bad registries set content:\n" + "- field 'name' required in top-level configuration" + ) + + +#################### +# Build Registries # +#################### + + +def test_build_registries(fake_client, build_registries_payload): + """Test the build registries endpoint.""" + mock_registries = Mock(spec=models.RegistryAssertion) + expected_registries = models.RegistryAssertion(**build_registries_payload) + fake_client.request.return_value = FakeResponse( + status_code=200, content=json.dumps(build_registries_payload).encode() + ) + + registries_set = client.StoreClientCLI().build_registries( + registries=mock_registries + ) + + assert registries_set == expected_registries + assert fake_client.request.mock_calls == [ + call( + "POST", + "https://dashboard.snapcraft.io/api/v2/registries/build-assertion", + headers={ + "Content-Type": "application/json", + "Accept": "application/json", + }, + json=mock_registries.marshal(), + ) + ] + + +def test_build_registries_unmarshal_error(fake_client, build_registries_payload): + """Raise an error if the response cannot be unmarshalled.""" + mock_registries = Mock(spec=models.RegistryAssertion) + build_registries_payload.pop("name") + fake_client.request.return_value = FakeResponse( + status_code=200, content=json.dumps(build_registries_payload).encode() + ) + + with pytest.raises(errors.SnapcraftAssertionError) as raised: + client.StoreClientCLI().build_registries(registries=mock_registries) + + assert str(raised.value) == "Received invalid registries set from the store" + assert raised.value.details == ( + "Bad registries set content:\n" + "- field 'name' required in top-level configuration" + ) + + +################### +# Post Registries # +################### + + +def test_post_registries(fake_client, post_registries_payload): + """Test the post registries endpoint.""" + expected_registries = models.RegistryAssertion( + **post_registries_payload["assertions"][0]["headers"], + body=post_registries_payload["assertions"][0]["body"], + ) + fake_client.request.return_value = FakeResponse( + status_code=200, content=json.dumps(post_registries_payload).encode() + ) + + registries_set = client.StoreClientCLI().post_registries( + registries_data=b"test-data" + ) + + assert registries_set == expected_registries + assert fake_client.request.mock_calls == [ + call( + "POST", + "https://dashboard.snapcraft.io/api/v2/registries", + headers={ + "Accept": "application/json", + "Content-Type": "application/x.ubuntu.assertion", + }, + data=b"test-data", + ) + ] + + +@pytest.mark.parametrize("num_assertions", [0, 2]) +def test_post_registries_wrong_payload_error( + num_assertions, fake_client, post_registries_payload +): + """Error if the wrong number of assertions are returned.""" + post_registries_payload["assertions"] = ( + post_registries_payload["assertions"] * num_assertions + ) + fake_client.request.return_value = FakeResponse( + status_code=200, content=json.dumps(post_registries_payload).encode() + ) + + with pytest.raises(errors.SnapcraftAssertionError) as raised: + client.StoreClientCLI().post_registries(registries_data=b"test-data") + + assert str(raised.value) == "Received invalid registries set from the store" + + +def test_post_registries_unmarshal_error(fake_client, post_registries_payload): + """Raise an error if the response cannot be unmarshalled.""" + post_registries_payload["assertions"][0]["headers"].pop("name") + fake_client.request.return_value = FakeResponse( + status_code=200, content=json.dumps(post_registries_payload).encode() + ) + + with pytest.raises(errors.SnapcraftAssertionError) as raised: + client.StoreClientCLI().post_registries(registries_data=b"test-data") + + assert str(raised.value) == "Received invalid registries set from the store" + assert raised.value.details == ( + "Bad registries set content:\n" + "- field 'name' required in top-level configuration" + ) + + ######################## # OnPremStoreClientCLI # ######################## diff --git a/tests/unit/test_application.py b/tests/unit/test_application.py index ad1dab8a0b..ea86a2b518 100644 --- a/tests/unit/test_application.py +++ b/tests/unit/test_application.py @@ -355,17 +355,6 @@ def test_application_dotnet_not_registered(base, build_base, snapcraft_yaml): assert "dotnet" not in craft_parts.plugins.get_registered_plugins() -@pytest.mark.parametrize("base", const.CURRENT_BASES) -def test_application_poetry_not_registered(base, snapcraft_yaml): - """poetry plugin is disabled for all bases.""" - snapcraft_yaml(base=base) - app = application.create_app() - - app._register_default_plugins() - - assert "poetry" not in craft_parts.plugins.get_registered_plugins() - - def test_default_command_integrated(monkeypatch, mocker, new_dir): """Test that for core24 projects we accept "pack" as the default command.""" diff --git a/tools/brew_install_from_source.py b/tools/brew_install_from_source.py index b4c3029fca..3c797464ed 100755 --- a/tools/brew_install_from_source.py +++ b/tools/brew_install_from_source.py @@ -46,10 +46,7 @@ def main(): def download_snapcraft_source(dest_dir): dest_file = os.path.join(dest_dir, "snapcraft-0.1.tar.gz") - branch_source = "https://github.com/{}/archive/{}.tar.gz".format( - os.environ.get("TRAVIS_PULL_REQUEST_SLUG") or "canonical/snapcraft", - os.environ.get("TRAVIS_PULL_REQUEST_BRANCH") or "main", - ) + branch_source = "https://github.com/canonical/snapcraft/archive/main.tar.gz" print("Downloading branch source from {}".format(branch_source)) urllib.request.urlretrieve(branch_source, dest_file) # noqa S310 return dest_file diff --git a/tools/collect_ppa_autopkgtests_results.py b/tools/collect_ppa_autopkgtests_results.py deleted file mode 100755 index e6a1cb8019..0000000000 --- a/tools/collect_ppa_autopkgtests_results.py +++ /dev/null @@ -1,95 +0,0 @@ -#!/usr/bin/env python3 -# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- -# -# Copyright (C) 2017 Canonical Ltd -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 3 as -# published by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -import argparse -import os -import subprocess -import tempfile - -ACTIVE_DISTROS = ("xenial", "artful", "bionic") - - -def main(): - parser = argparse.ArgumentParser() - parser.add_argument("day", help="The day of the results, with format yyyymmdd") - args = parser.parse_args() - install_autopkgtest_results_formatter() - with tempfile.TemporaryDirectory(dir=os.environ.get("HOME")) as temp_dir: - clone_results_repo(temp_dir) - format_results(temp_dir, ACTIVE_DISTROS, args.day) - commit_and_push(temp_dir, args.day) - - -def install_autopkgtest_results_formatter(): - subprocess.check_call( - ["sudo", "snap", "install", "autopkgtest-results-formatter", "--edge"] - ) - - -def clone_results_repo(dest_dir): - subprocess.check_call( - ["git", "clone", "https://github.com/elopio/autopkgtest-results.git", dest_dir] - ) - - -def format_results(dest_dir, distros, day): - subprocess.check_call( - [ - "/snap/bin/autopkgtest-results-formatter", - "--destination", - dest_dir, - "--distros", - *distros, - "--day", - day, - ] - ) - - -def commit_and_push(repo_dir, day): - subprocess.check_call( - ["git", "config", "--global", "user.email", "u1test+m-o@canonical.com"] - ) - subprocess.check_call(["git", "config", "--global", "user.name", "snappy-m-o"]) - - subprocess.check_call(["git", "-C", repo_dir, "add", "--all"]) - subprocess.check_call( - [ - "git", - "-C", - repo_dir, - "commit", - "--message", - "Add the results for {}".format(day), - ] - ) - - subprocess.check_call( - [ - "git", - "-C", - repo_dir, - "push", - "https://{GH_TOKEN}@github.com/elopio/autopkgtest-results.git".format( - GH_TOKEN=os.environ.get("GH_TOKEN_PPA_AUTOPKGTEST_RESULTS") - ), - ] - ) - - -if __name__ == "__main__": - main() diff --git a/tools/freeze-requirements.sh b/tools/freeze-requirements.sh index 22723c420a..5f086892ee 100755 --- a/tools/freeze-requirements.sh +++ b/tools/freeze-requirements.sh @@ -5,7 +5,7 @@ requirements_fixups() { # Python apt library pinned to source. sed -i '/python-apt=*/d' "$req_file" - echo 'python-apt @ https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/python-apt/2.4.0ubuntu1/python-apt_2.4.0ubuntu1.tar.xz; sys.platform == "linux"' >> "$req_file" + echo 'python-apt @ https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/python-apt/2.4.0ubuntu1/python-apt_2.4.0ubuntu1.tar.xz ; sys.platform == "linux"' >> "$req_file" # https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/1635463 sed -i '/pkg[-_]resources==0.0.0/d' "$req_file" diff --git a/tools/retry_autopkgtest.sh b/tools/retry_autopkgtest.sh deleted file mode 100755 index 0d479acd7d..0000000000 --- a/tools/retry_autopkgtest.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/bash -# -# Retry the autopkgtest run in a pull request. -# Arguments: -# pr: The identifier of the pull request to test. -# [release[:architecture[:test]] ...]: A list of the names of the Ubuntu releases and -# architectures and tests to run. By default, it will launch all the tests in -# `xenial:amd64`. If only the release name is passed as an argument, `amd64` -# will be used as the architecture. The possible autopkgtests are `integrationtests` -# and `snapstests`. -# -# Environment variables: -# SNAPCRAFT_AUTOPKGTEST_SECRET: The secret to authenticate the test execution. -# -# Examples: -# Run all the tests for pull request #123 in xenial amd64: -# ./tools/retry_autopkgtest.sh 123 -# Run all the tests for pull request #123 in xenial armhf: -# ./tools/retry_autopkgtest.sh 123 xenial:armhf -# Run all the tests for pull request #123 in xenial arm64, yakkety armhf and -# zesty amd64: -# ./tools/retry_autopkgtest.sh 123 xenial:arm64 yakkety:armhf zesty -# Run the integration tests for pull request #123 in xenial amd64: -# ./tools/retry_autopkgtest.sh 123 xenial:amd64:integrationtests - -if [ -z "${SNAPCRAFT_AUTOPKGTEST_SECRET}" ]; then - echo 'Set the secret to the environment variable SNAPCRAFT_AUTOPKGTEST_SECRET.' - exit 1 -fi - -if [ "$#" -lt 1 ]; then - echo "Usage: $0 [release[:architecture[:test]] ...]" - exit 1 -fi - -pr="$1" -shift -tests=("$@") -[ ${#tests[@]} -eq 0 ] && tests=('xenial:amd64') - -temp_dir="$(mktemp -d)" -trap 'rm -rf ${temp_dir}' EXIT - -# Download the retry script. -wget https://git.launchpad.net/autopkgtest-cloud/plain/tools/retry-github-test -O "${temp_dir}/retry-github-test" -chmod +x "${temp_dir}/retry-github-test" - -# Save the secret to a file. -echo "${SNAPCRAFT_AUTOPKGTEST_SECRET}" > "${temp_dir}/sec.txt" - -for testrun in "${tests[@]}"; do - IFS=':' read -r release architecture testsuite <<< "$testrun" - [ -z "$architecture" ] && architecture='amd64' - [ -n "$testsuite" ] && testname="&testname=${testsuite}" - echo "Launching tests for the ${release} release in the ${architecture} architecture..." - "${temp_dir}/retry-github-test" "https://api.github.com/repos/canonical/snapcraft/pulls/${pr}" "https://autopkgtest.ubuntu.com/request.cgi?release=${release}&arch=${architecture}&package=snapcraft${testname}&ppa=snappy-dev%2Fsnapcraft-daily" "${temp_dir}/sec.txt" -done diff --git a/tools/run_ppa_autopkgtests.py b/tools/run_ppa_autopkgtests.py deleted file mode 100755 index 8f5450c4a2..0000000000 --- a/tools/run_ppa_autopkgtests.py +++ /dev/null @@ -1,92 +0,0 @@ -#!/usr/bin/env python -# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- -# -# Copyright (C) 2017 Canonical Ltd -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 3 as -# published by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -import os -import subprocess -import sys -import tempfile - -from launchpadlib.launchpad import Launchpad - -ACTIVE_DISTROS = ("xenial", "artful", "bionic") -ACTIVE_ARCHITECTURES = ("amd64", "i386", "armhf", "arm64") - - -def main(): - try: - cookie_file_path = save_cookie() - for distro, architecture, version in snapcraft_ppa_packages(): - request_autopkgtest_execution( - cookie_file_path, distro, architecture, version - ) - finally: - os.remove(cookie_file_path) - - -def save_cookie(): - cookie_file = tempfile.NamedTemporaryFile(delete=False) - cookie_file.write( - "autopkgtest.ubuntu.com\tTRUE\t/\tTRUE\t0\tsession\t{}".format( - os.environ.get("SNAPCRAFT_AUTOPKGTEST_COOKIE") - ) - ) - cookie_file.close() - return cookie_file.name - - -def snapcraft_ppa_packages(): - launchpad = Launchpad.login_anonymously("snappy-m-o", "production") - ubuntu = launchpad.distributions["ubuntu"] - snapcraft_daily_ppa = launchpad.people["snappy-dev"].getPPAByName( - name="snapcraft-daily" - ) - - for distro in ACTIVE_DISTROS: - for architecture in ACTIVE_ARCHITECTURES: - distro_arch = ubuntu.getSeries(name_or_version=distro).getDistroArchSeries( - archtag=architecture - ) - for package in snapcraft_daily_ppa.getPublishedBinaries( - status="Published", - binary_name="snapcraft", - exact_match=True, - distro_arch_series=distro_arch, - ): - yield distro, architecture, str(package.binary_package_version) - - -def request_autopkgtest_execution(cookie_path, distro, architecture, version): - output = subprocess.check_output( - [ - "wget", - "-O-", - "--load-cookies", - cookie_path, - "https://autopkgtest.ubuntu.com/request.cgi?release={distro}&" - "arch={architecture}&package=snapcraft&" - "ppa=snappy-dev/snapcraft-daily&" - "trigger=snapcraft/{version}".format( - distro=distro, architecture=architecture, version=version - ), - ] - ) - if "Test request submitted" not in output: - sys.exit("Failed to request the autopkgtest") - - -if __name__ == "__main__": - main()