Skip to content
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

chore(merge): 'main' into 'work/CRAFT-3154/craft-platforms' #486

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
c2f0978
build!: update to pydantic 2 (#401)
lengau Aug 2, 2024
a130b31
fix: correctly convert root-level errors
tigarmo Aug 2, 2024
d49e539
fix: _populate_platforms() returns dicts of dicts
tigarmo Aug 5, 2024
3d23ac0
feat: make "get_validator_by_regex()" public
tigarmo Aug 6, 2024
2f8dd7c
feat: add to_yaml_string()
tigarmo Aug 6, 2024
1325427
feat: validate each part individually
tigarmo Aug 6, 2024
5b1a78b
chore: drop 'value error, ' prefix from validation errors
tigarmo Aug 6, 2024
fb24fea
build(deps): point to craft-providers feature/2.0 branch
mr-cal Aug 7, 2024
03bf7c5
feat: add validators that handle licenses (#402)
dariuszd21 Aug 8, 2024
7ab4e6c
chore: set correct dependencies
lengau Aug 8, 2024
3855157
Merge branch 'main' into feature/pydantic-2
lengau Aug 8, 2024
25ea79c
style(type): fix typing issues
lengau Aug 9, 2024
c3aae96
chore!: merge pydantic 2 feature branch to main
lengau Aug 9, 2024
a00bf9b
docs: add 4.0.0 release to changelog
lengau Aug 9, 2024
947e1b4
feat(lifecycle): break out _get_build_for method (#414)
lengau Aug 13, 2024
dbee926
fix: allow using a snap from the snap store (#417)
lengau Aug 14, 2024
db9f21b
ci: update renovate config from starbase (#409)
lengau Aug 14, 2024
499fa41
build(deps): update development and build dependencies (#418)
lengau Aug 14, 2024
20a1e10
docs: add 4.1.0 changelog entry (#421)
lengau Aug 14, 2024
2f56f14
style(lint): fix ruff 0.6.0 linting errors (#423)
lengau Aug 19, 2024
df906c3
fix(yaml): wrap error message for YAML errors (#427)
lengau Aug 23, 2024
c988199
feat: tell the user which platforms matched when failing (#428)
mattculler Aug 26, 2024
fac7490
docs(changelog): add release notes for 4.1.1
mattculler Aug 27, 2024
276d4f3
Merge pull request #432 from canonical/release/4.1.1
mattculler Aug 27, 2024
1509cec
docs: add environment variables reference (#431)
lengau Aug 28, 2024
de48adc
fix: provide more info in YAML errors (#433)
lengau Aug 29, 2024
a49a3ea
feat(provider): use standard library to get proxies (#426)
lengau Aug 30, 2024
5e7560e
fix: fail managed runs if the build plan is empty
tigarmo Sep 2, 2024
ab55ec8
feat: support shell/shell-after and debug in 'pack' (#436)
tigarmo Sep 4, 2024
d697898
fix(platform): automatically vectorise architectures (#442)
lengau Sep 5, 2024
2fe26ce
fix: fail managed runs if the build plan is empty
tigarmo Sep 2, 2024
365cf2f
fix: provide more info in YAML errors (#433)
lengau Aug 29, 2024
c8ccf47
docs: add 4.1.2 to changelog
lengau Sep 5, 2024
0cc14b4
chore: merge branch 'main' into hotfix-merge/4.1.2
lengau Sep 5, 2024
5ceac0d
chore(release): merge 4.1.2 release to main
lengau Sep 6, 2024
bbb1d72
feat: replace ServiceFactory.set_kwargs with ServiceFactory.update_kw…
lengau Sep 6, 2024
4d7bc64
feat: add a configuration service (#416)
lengau Sep 6, 2024
45ec282
build(deps): update dependency pytest-check to v2.4.1 (#446)
renovate[bot] Sep 6, 2024
2837322
chore: update pre-commit hooks (#441)
lengau Sep 6, 2024
260bd46
build(deps): update dependency sphinx-autobuild to v2024.9.3 (#449)
renovate[bot] Sep 6, 2024
d96da4e
build(deps): update dependency mypy to v1.11.2 (#448)
renovate[bot] Sep 6, 2024
f8513c8
build(deps): update dependency setuptools to v74 (#447)
renovate[bot] Sep 6, 2024
dc1928f
fix(models): coerce numbers to strings by default (#450)
lengau Sep 6, 2024
244b52c
tests: re-enable almalinux tests (#445)
lengau Sep 9, 2024
2bda257
chore(test): put ids on some hard-to-trigger tests (#451)
lengau Sep 9, 2024
a8c7876
docs: add changelog for 4.2.0 (#457)
tigarmo Sep 11, 2024
22909db
feat: add initial FetchService skeleton (#7)
tigarmo Jun 10, 2024
ff76bb5
feat: start the fetch-service (#8)
tigarmo Jun 13, 2024
a047ae4
feat: create/teardown fetch-service sessions (#9)
tigarmo Jun 14, 2024
bdb374c
feat: configure build instances for fetch-service (#11)
tigarmo Jun 17, 2024
6bcddf9
fix: set REQUESTS_CA_BUNDLE for the fetch-service env. (#16)
tigarmo Jul 4, 2024
8c1096d
feat: generate the fetch-service certificate
tigarmo Jul 23, 2024
5a369df
fix: set CARGO_HTTP_CAINFO for the fetch-service env
tigarmo Jul 25, 2024
ae025ad
chore(test): set correct deb mimetype back
tigarmo Jul 26, 2024
d521195
feat: dump the fetch-service report
tigarmo Jun 27, 2024
33595c0
feat(fetch): default to creating permissive sessions
tigarmo Jul 26, 2024
5827eeb
fix: use fetch-service's common dir for certificate
tigarmo Jul 29, 2024
b6caa9c
chore: log the fetch-service command line
tigarmo Jul 29, 2024
b7355b5
feat: always shutdown the fetch-service
tigarmo Jul 29, 2024
15b3c1d
chore: redirect output of 'apt update'
tigarmo Jul 29, 2024
9a6d450
style(lint): fix ruff 0.6.0 fetch-service errors
tigarmo Aug 28, 2024
a70bf86
fix: better error if the fetch-service is missing (#55)
tigarmo Aug 29, 2024
ef85eee
feat: add an argument to enable the fetch service (#53)
tigarmo Aug 30, 2024
c9ccccf
feat: proper logging for the fetch-service (#56)
tigarmo Sep 6, 2024
c8e923a
chore: disable port conflict test (#64)
tigarmo Sep 11, 2024
1ae919c
docs(changelog): add release notes for 4.1.3 (#459)
mr-cal Sep 12, 2024
5be3430
chore: merge branch 'main' into release-merge/4.1.3
lengau Sep 12, 2024
1216017
chore: merge release 4.1.3 into main (#460)
tigarmo Sep 13, 2024
f175c96
fix(models): coerce numbers to strings by default (#450)
lengau Sep 6, 2024
4dcba1c
docs(changelog): add 4.2.1 to changelog
lengau Sep 13, 2024
a66b217
Merge branch 'main' into hotfix-merge/4.2.1
lengau Sep 13, 2024
2d7805a
chore: merge 4.2.1 to main
lengau Sep 13, 2024
ac73285
chore: factor run logic outside of try block
sergiusens Sep 13, 2024
a5349c5
chore: factor run logic outside of try block
sergiusens Sep 13, 2024
ca42796
docs: add 4.2.2 to changelog
lengau Sep 13, 2024
41b699e
chare: merge branch 'main' into hotfix-merge/4.2.2
lengau Sep 13, 2024
8ac3f3d
chore: merge 4.2.2 to main
lengau Sep 13, 2024
d872bfd
ci: use the default version of lxd for integration tests (#461)
lengau Sep 13, 2024
ba3be78
feat(provider): add a way to clean existing instances
tigarmo Sep 13, 2024
e931a59
feat: wipe existing instances when using the fetch-service
tigarmo Sep 13, 2024
77a3582
fix: inject aliased snaps into build environment (#467)
mr-cal Sep 16, 2024
e546fae
feat: set the fetch-service to idle shutdown
tigarmo Sep 6, 2024
f6627fb
fix(app): get_arg_or_config gets environment correctly
lengau Sep 18, 2024
8afd506
docs(changelog): add 4.2.3 to changelog
lengau Sep 18, 2024
d448c44
feat(docs): update partitions docs (#475)
mattculler Sep 18, 2024
f2834d9
chore: merge branch 'origin/main' into release-merge/4.2.3
lengau Sep 18, 2024
616b3f0
chore: merge 4.2.3 to main
lengau Sep 18, 2024
ce7e69d
Merge branch 'main' into work/CRAFT-3154/craft-platforms
dariuszd21 Sep 18, 2024
092d34a
test: fix broken uts after merge
dariuszd21 Sep 19, 2024
d5ef878
test: fix fixtures instantation order
dariuszd21 Sep 20, 2024
e3c2b48
test: fix fetch-service tests
dariuszd21 Sep 20, 2024
93de59b
test: uncomment test for allbuilf-for
dariuszd21 Sep 20, 2024
760ecad
chore: use craft-platforms in MultipleBuildsError
dariuszd21 Sep 20, 2024
062ebd0
chore: use craft-platforms in remaing tests
dariuszd21 Sep 20, 2024
65bcf1a
chore: cast items before passing to build_plan
dariuszd21 Sep 20, 2024
6a74436
chore(lint): fix codespell complaints
dariuszd21 Sep 20, 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
65 changes: 48 additions & 17 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
{
// Configuration file for RenovateBot: https://docs.renovatebot.com/configuration-options
extends: ["config:base"],
extends: ["config:recommended", ":semanticCommitTypeAll(build)"],
labels: ["dependencies"], // For convenient searching in GitHub
baseBranches: ["$default", "/^hotfix\\/.*/"],
pip_requirements: {
fileMatch: ["^tox.ini$", "(^|/)requirements([\\w-]*)\\.txt$", "^.pre-commit-config.yaml$"]
},
packageRules: [
{
// Internal package minor patch updates get top priority, with auto-merging
groupName: "internal package patch releases",
groupName: "internal package minor releases",
matchPackagePatterns: ["^craft-.*"],
matchUpdateTypes: ["minor", "patch", "pin", "digest"],
prPriority: 10,
automerge: true,
minimumReleaseAge: "0 seconds",
schedule: ["at any time"],
matchBaseBranches: ["$default"], // Only do minor releases on main
},
{
// Same as above, but for hotfix branches, only for patch, and without auto-merging.
Expand All @@ -24,23 +26,24 @@
prPriority: 10,
minimumReleaseAge: "0 seconds",
schedule: ["at any time"],
matchBaseBranches: ["/^hotfix/.*/"], // All hotfix branches
matchBaseBranches: ["/^hotfix\\/.*/"], // All hotfix branches
},
{
// Automerge patches, pin changes and digest changes.
// Also groups these changes together.
groupName: "bugfixes",
excludePackagePrefixes: ["lint", "types"],
excludeDepPatterns: ["lint/.*", "types/.*"],
matchUpdateTypes: ["patch", "pin", "digest"],
prPriority: 3, // Patches should go first!
automerge: true
},
{
// Update all internal packages in one higher-priority PR
groupName: "internal packages",
matchPackagePrefixes: ["craft-", "snap-"],
matchLanguages: ["python"],
prPriority: 2
matchDepPatterns: ["craft-.*", "snap-.*"],
matchCategories: ["python"],
prPriority: 2,
matchBaseBranches: ["$default"], // Not for hotfix branches
},
{
// GitHub Actions are higher priority to update than most dependencies since they don't tend to break things.
Expand All @@ -59,10 +62,32 @@
// Minor changes can be grouped and automerged for dev dependencies, but are also deprioritised.
groupName: "development dependencies (non-major)",
groupSlug: "dev-dependencies",
matchPackagePrefixes: [
"dev",
"lint",
"types"
matchDepPatterns: [
"dev/.*",
"lint/.*",
"types/.*"
],
matchPackagePatterns: [
// Brought from charmcraft. May not be complete.
// This helps group dependencies in requirements-dev.txt files.
"^(.*/)?autoflake$",
"^(.*/)?black$",
"^(.*/)?codespell$",
"^(.*/)?coverage$",
"^(.*/)?flake8$",
"^(.*/)?hypothesis$",
"^(.*/)?mypy$",
"^(.*/)?pycodestyle$",
"^(.*/)?docstyle$",
"^(.*/)?pyfakefs$",
"^(.*/)?pyflakes$",
"^(.*/)?pylint$",
"^(.*/)?pytest",
"^(.*/)?responses$",
"^(.*/)?ruff$",
"^(.*/)?twine$",
"^(.*/)?tox$",
"^(.*/)?types-",
],
matchUpdateTypes: ["minor", "patch", "pin", "digest"],
prPriority: -1,
Expand All @@ -74,32 +99,37 @@
groupSlug: "doc-dependencies",
matchPackageNames: ["Sphinx", "furo"],
matchPackagePatterns: ["[Ss]phinx.*$"],
matchPackagePrefixes: ["docs"],
matchDepPatterns: ["docs/.*"],
matchBaseBranches: ["$default"], // Not for hotfix branches
},
{
// Other major dependencies get deprioritised below minor dev dependencies.
matchUpdateTypes: ["major"],
prPriority: -2
prPriority: -2,
matchBaseBranches: ["$default"], // Not for hotfix branches
},
{
// Major dev dependencies are stone last, but grouped.
groupName: "development dependencies (major versions)",
groupSlug: "dev-dependencies",
matchDepTypes: ["devDependencies"],
matchUpdateTypes: ["major"],
prPriority: -3
prPriority: -3,
matchBaseBranches: ["$default"], // Not for hotfix branches
},
{
// Pyright makes regular breaking changes in patch releases, so we separate these
// and do them independently.
matchPackageNames: ["pyright", "types/pyright"],
prPriority: -4
prPriority: -4,
matchBaseBranches: ["$default"], // Not for hotfix branches
}
],
regexManagers: [
customManagers: [
{
// tox.ini can get updates too if we specify for each package.
fileMatch: ["tox.ini"],
customType: "regex",
depTypeTemplate: "devDependencies",
matchStrings: [
"# renovate: datasource=(?<datasource>\\S+)\n\\s+(?<depName>.*?)(\\[[\\w]*\\])*[=><]=?(?<currentValue>.*?)\n"
Expand All @@ -108,6 +138,7 @@
{
// .pre-commit-config.yaml version updates
fileMatch: [".pre-commit-config.yaml"],
customType: "regex",
datasourceTemplate: "pypi",
depTypeTemplate: "lint",
matchStrings: [
Expand All @@ -122,7 +153,7 @@
prCreation: "not-pending", // Wait until status checks have completed before raising the PR
prNotPendingHours: 4, // ...unless the status checks have been running for 4+ hours.
prHourlyLimit: 1, // No more than 1 PR per hour.
stabilityDays: 2, // Wait 2 days from release before updating.
minimumReleaseAge: "2 days",
automergeStrategy: "squash", // Squash & rebase when auto-merging.
semanticCommitType: "build" // use `build` as commit header type (i.e. `build(deps): <description>`)
}
40 changes: 40 additions & 0 deletions .github/workflows/check-renovate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Renovate check
on:
pull_request:
paths:
- ".github/workflows/check-renovate.yaml"
- ".github/renovate.json5"

# Allows triggering the workflow manually from the Actions tab
workflow_dispatch:
inputs:
enable_ssh_access:
type: boolean
description: 'Enable ssh access'
required: false
default: false

jobs:
renovate:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install node
uses: actions/setup-node@v4
with:
node-version: 22
- name: Install renovate
run: npm install --global renovate
- name: Enable ssh access
uses: mxschmitt/action-tmate@v3
if: ${{ inputs.enable_ssh_access }}
with:
limit-access-to-actor: true
- name: Check renovate config
run: renovate-config-validator .github/renovate.json5
- name: Renovate dry-run
run: renovate --dry-run --autodiscover
env:
RENOVATE_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RENOVATE_USE_BASE_BRANCH_CONFIG: ${{ github.ref }}
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/setup-lxd@v0.1.1
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/setup-lxd@v0.1.1
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=beta 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: 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