Skip to content

fix: correct the way that requested pro services are matched with enabled pro services #581

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 106 commits into
base: feature/pro-sources
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
66cda28
docs(changelog): add release notes for 4.1.1
mattculler Aug 27, 2024
15e6ba5
fix(platform): automatically vectorise architectures (#442)
lengau Sep 5, 2024
7584049
fix: fail managed runs if the build plan is empty
tigarmo Sep 2, 2024
c55e2d2
fix: provide more info in YAML errors (#433)
lengau Aug 29, 2024
5cc9429
docs: add 4.1.2 to changelog
lengau Sep 5, 2024
e146ed5
docs: add environment variables reference (#431)
lengau Aug 28, 2024
9fa2183
feat(provider): use standard library to get proxies (#426)
lengau Aug 30, 2024
828d303
feat: support shell/shell-after and debug in 'pack' (#436)
tigarmo Sep 4, 2024
1384467
feat: replace ServiceFactory.set_kwargs with ServiceFactory.update_kw…
lengau Sep 6, 2024
cf58871
feat: add a configuration service (#416)
lengau Sep 6, 2024
0638ec1
build(deps): update dependency pytest-check to v2.4.1 (#446)
renovate[bot] Sep 6, 2024
ef939ab
chore: update pre-commit hooks (#441)
lengau Sep 6, 2024
4e1fa0b
build(deps): update dependency sphinx-autobuild to v2024.9.3 (#449)
renovate[bot] Sep 6, 2024
60a5729
build(deps): update dependency mypy to v1.11.2 (#448)
renovate[bot] Sep 6, 2024
b3146f0
build(deps): update dependency setuptools to v74 (#447)
renovate[bot] Sep 6, 2024
734d79f
tests: re-enable almalinux tests (#445)
lengau Sep 9, 2024
5ed566c
chore(test): put ids on some hard-to-trigger tests (#451)
lengau Sep 9, 2024
160c237
docs: add changelog for 4.2.0 (#457)
tigarmo Sep 11, 2024
bcb0dd4
fix(models): coerce numbers to strings by default (#450)
lengau Sep 6, 2024
04fab14
docs(changelog): add 4.2.1 to changelog
lengau Sep 13, 2024
08f98cb
chore: factor run logic outside of try block
sergiusens Sep 13, 2024
af57e66
docs: add 4.2.2 to changelog
lengau Sep 13, 2024
ad08aa0
fix: inject aliased snaps into build environment (#467)
mr-cal Sep 16, 2024
6520409
fix(app): get_arg_or_config gets environment correctly
lengau Sep 18, 2024
0c8c337
docs(changelog): add 4.2.3 to changelog
lengau Sep 18, 2024
b4cc784
refactor: subclass remote-build errors from CraftError
mr-cal Sep 19, 2024
a2e1163
docs(changelog): add 4.2.4 release notes
mr-cal Sep 19, 2024
da0e60a
fix(config): warn on snapctl errors (#497)
lengau Oct 1, 2024
7bbbfaf
fix(config): wrap snap config handler in snap check (#499)
lengau Oct 4, 2024
8edef5a
fix(docs): freeze on canonical-sphinx 0.1
lengau Oct 4, 2024
32825dc
docs(changelog): release 4.2.5
lengau Oct 4, 2024
e2bf042
build(deps): unpin requests
mr-cal Oct 4, 2024
4382ab5
docs(changelog): add 4.2.6 release notes
mr-cal Oct 4, 2024
76a2ae1
fix: set correct parallel build count in scripts (#517)
mattculler Oct 8, 2024
6657806
build(deps): loosen requests dependency
lengau Oct 8, 2024
122e81b
docs(changelog): add 4.2.7 to changelog
lengau Oct 8, 2024
6b31feb
docs(changelog): add release notes for 4.1.3 (#459)
mr-cal Sep 12, 2024
d0b9a1e
feat: add initial FetchService skeleton (#7)
tigarmo Jun 10, 2024
028affe
feat: start the fetch-service (#8)
tigarmo Jun 13, 2024
7b74080
feat: create/teardown fetch-service sessions (#9)
tigarmo Jun 14, 2024
cb5e735
feat: configure build instances for fetch-service (#11)
tigarmo Jun 17, 2024
dcbdbd1
fix: set REQUESTS_CA_BUNDLE for the fetch-service env. (#16)
tigarmo Jul 4, 2024
f1b2802
feat: generate the fetch-service certificate
tigarmo Jul 23, 2024
b2680b8
fix: set CARGO_HTTP_CAINFO for the fetch-service env
tigarmo Jul 25, 2024
0f4381b
chore(test): set correct deb mimetype back
tigarmo Jul 26, 2024
4647dda
feat: dump the fetch-service report
tigarmo Jun 27, 2024
5bc8948
feat(fetch): default to creating permissive sessions
tigarmo Jul 26, 2024
3f71ae3
fix: use fetch-service's common dir for certificate
tigarmo Jul 29, 2024
9c0f3ff
chore: log the fetch-service command line
tigarmo Jul 29, 2024
de79246
feat: always shutdown the fetch-service
tigarmo Jul 29, 2024
8ff5c42
chore: redirect output of 'apt update'
tigarmo Jul 29, 2024
322af37
style(lint): fix ruff 0.6.0 fetch-service errors
tigarmo Aug 28, 2024
32806af
fix: better error if the fetch-service is missing (#55)
tigarmo Aug 29, 2024
a000bc7
feat: add an argument to enable the fetch service (#53)
tigarmo Aug 30, 2024
9bccc7c
feat: proper logging for the fetch-service (#56)
tigarmo Sep 6, 2024
99ed5f5
chore: disable port conflict test (#64)
tigarmo Sep 11, 2024
1d8f5e5
ci: use the default version of lxd for integration tests (#461)
lengau Sep 13, 2024
344c496
feat(provider): add a way to clean existing instances
tigarmo Sep 13, 2024
7432f28
feat: wipe existing instances when using the fetch-service
tigarmo Sep 13, 2024
a7d28df
feat: set the fetch-service to idle shutdown
tigarmo Sep 6, 2024
fce0652
feat(docs): update partitions docs (#475)
mattculler Sep 18, 2024
2028206
feat: models for the craft manifest (#473)
tigarmo Sep 19, 2024
ad448fc
feat: generate project manifest in managed runs
tigarmo Sep 17, 2024
f33c70e
feat: create the final craft manifest
tigarmo Sep 19, 2024
9cac2cb
feat: support "--platform" for "clean"
tigarmo Sep 19, 2024
d7fbf0e
feat: set GOPROXY=direct in fetch-service runs (#489)
tigarmo Sep 24, 2024
6fa9d4c
feat: allow strict/permissive fetch-service sessions (#490)
tigarmo Sep 25, 2024
e18b85f
ci: add security scanning job (#494)
lengau Oct 1, 2024
b5de38c
feat: mark the fetch-service integration as experimental (#496)
tigarmo Oct 1, 2024
6bd83bf
feat: add craft-platforms compatibility methods (#495)
lengau Oct 1, 2024
cc6bef5
fix(docs): fix docs for canonical-sphinx 0.2 (#498)
lengau Oct 3, 2024
bbc94fb
build(deps): update pyright (#515)
lengau Oct 10, 2024
33f6607
build(deps): update bugfixes (#510)
renovate[bot] Oct 10, 2024
e4e251f
chore: rename parameter to "--enable-fetch-service"
tigarmo Oct 10, 2024
c1cfab6
feat: parse artifact rejection reason
tigarmo Oct 8, 2024
0f411ae
feat: report fetch-service rejections
tigarmo Oct 8, 2024
226757c
docs: changelog for 4.3.0
tigarmo Oct 11, 2024
db25396
build(deps): update bugfixes (#523)
renovate[bot] Oct 16, 2024
6374b35
build(deps): update dependency setuptools to v75 (#526)
renovate[bot] Oct 17, 2024
9c53248
build(deps): update dependency sphinx-autobuild to v2024.10.3 (#524)
renovate[bot] Oct 17, 2024
faabd24
build(deps): update dependency tox-gh to v1.4.4 (#525)
renovate[bot] Oct 17, 2024
66d64db
build(deps): update dependency sphinx-lint to v1 (#527)
renovate[bot] Oct 17, 2024
db98e28
build(deps): update dependency setuptools to v75.2.0 (#535)
renovate[bot] Oct 21, 2024
fb5f282
build(deps): update dependency pyright to v1.1.385 (#532)
renovate[bot] Oct 21, 2024
812224c
build(deps): update dependency mypy to v1.12.0 (#533)
renovate[bot] Oct 21, 2024
19bdd2c
chore(ci): generate release notes when publishing (#538)
tigarmo Oct 22, 2024
0e477a1
feat: pass the app_config to pre_parse_args() (#541)
tigarmo Oct 22, 2024
abe2ca9
chore: log snap installation method (#539)
mr-cal Oct 22, 2024
9c99bae
feat: add init service and init command (#522)
mr-cal Oct 22, 2024
2177890
fix: don't start the fetch-service in managed mode (#542)
tigarmo Oct 23, 2024
4211b24
fix: cleanup UI for fetch-service-related commands (#544)
tigarmo Oct 24, 2024
854813c
feat(application): merge commands within groups (#545)
mr-cal Oct 24, 2024
862ff3d
docs(changelog): add 4.4.0 release notes (#553)
mr-cal Nov 8, 2024
28e238e
chore: use 'candidate' fetch-service (#547)
tigarmo Nov 11, 2024
9a7637a
build(deps): bump minimum craft-cli to 2.10.1
tigarmo Nov 11, 2024
2bc1acc
feat: generate version for templates usage (#548)
dariuszd21 Nov 12, 2024
d6aba6b
feat: add documentation link in help messages (#557)
mr-cal Nov 18, 2024
cf93e50
ci(rtd): pin python version to 3.12 (#562)
dariuszd21 Nov 21, 2024
9b58e55
chore(lint): get around a Pydantic 2.10.x type bug (#566)
tigarmo Nov 25, 2024
78dbc99
feat: improve name handling in 'init' (#567)
tigarmo Nov 27, 2024
a2c2032
fix: properly log the fetch-service's output (#555)
tigarmo Nov 28, 2024
a06176c
docs: finish changelog for 4.5.0 (#570)
tigarmo Nov 28, 2024
e6b1b47
fix: allow building non-Pro rocks on a Pro host in managed mode
Dec 4, 2024
87a12fc
fix linting errors
Dec 4, 2024
d00a445
fix unit test
Dec 4, 2024
2d34504
fail only when requested service is not available in available_services
Dec 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/release-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ jobs:
- name: Release
uses: softprops/action-gh-release@v2
with:
# Generate release notes on the new GH release
generate_release_notes: true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like it comes from our changes to main, right? If so, could you separately merge main to this feature branch so the PR is cleaner?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lengau I put the changes from main in seperate PR #582. Please merge that one first.

# Add wheel and source tarball
files: |
*.whl
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/security-scan.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
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
13 changes: 7 additions & 6 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ jobs:
3.10
3.12
cache: 'pip'
- name: Setup LXD
uses: canonical/[email protected]
with:
channel: latest/stable
- name: Configure environment
run: |
echo "::group::apt-get"
Expand Down Expand Up @@ -111,10 +107,12 @@ jobs:
cache: 'pip'
- name: Setup LXD
uses: canonical/[email protected]
with:
channel: latest/stable
- name: Configure environment
run: |
echo "::group::Begin snap install"
echo "Installing snaps in the background while running apt and pip..."
sudo snap install --no-wait --channel=candidate fetch-service
echo "::endgroup::"
echo "::group::apt-get"
sudo apt update
sudo apt-get install -y libapt-pkg-dev
Expand All @@ -123,6 +121,9 @@ jobs:
python -m pip install tox
echo "::endgroup::"
mkdir -p results
echo "::group::Wait for snap to complete"
snap watch --last=install
echo "::endgroup::"
- name: Setup Tox environments
run: tox run -e integration-${{ matrix.python }} --notest
- name: Integration tests
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -14,17 +14,17 @@ repos:
- id: mixed-line-ending
- repo: https://github.com/charliermarsh/ruff-pre-commit
# renovate: datasource=pypi;depName=ruff
rev: "v0.0.267"
rev: "v0.6.3"
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/psf/black
# renovate: datasource=pypi;depName=black
rev: "23.3.0"
rev: "24.8.0"
hooks:
- id: black
- repo: https://github.com/adrienverge/yamllint.git
# renovate: datasource=pypi;depName=yamllint
rev: "v1.31.0"
rev: "v1.35.1"
hooks:
- id: yamllint
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sphinx:
build:
os: ubuntu-22.04
tools:
python: "3"
python: "3.12"

python:
install:
Expand Down
2 changes: 2 additions & 0 deletions craft_application/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
ProviderService,
ServiceFactory,
)
from craft_application._config import ConfigModel

try:
from ._version import __version__
Expand All @@ -42,6 +43,7 @@
"AppFeatures",
"AppMetadata",
"AppService",
"ConfigModel",
"models",
"ProjectService",
"LifecycleService",
Expand Down
37 changes: 37 additions & 0 deletions craft_application/_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This file is part of craft-application.
#
# Copyright 2024 Canonical Ltd.
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser 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 warranties of MERCHANTABILITY,
# SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""Configuration model for craft applications."""
from __future__ import annotations

import craft_cli
import pydantic


class ConfigModel(pydantic.BaseModel):
"""A configuration model for a craft application."""

verbosity_level: craft_cli.EmitterMode = craft_cli.EmitterMode.BRIEF
debug: bool = False
build_environment: str | None = None
secrets: str

platform: str | None = None
build_for: str | None = None

parallel_build_count: int
max_parallel_build_count: int
lxd_remote: str = "local"
launchpad_instance: str = "production"
Loading
Loading