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

Actions packaging quilt tests #23

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
0787d62
feat(snap): avoid refresh on package_upgrade: true and refresh.hold (…
blackboxsw Aug 7, 2024
edd92b7
fix: read_optional_seed to set network-config when present (#5593)
blackboxsw Aug 7, 2024
65014b9
Revert "fix(vmware): Set IPv6 to dhcp when there is no IPv6 addr (#54…
PengpengSun Aug 9, 2024
e3db1ad
chore: add comment explaining the NetworkManager may-fail setting (#5…
ani-sinha Aug 9, 2024
bd6cd1f
chore: Deprecate old commands in help output (#5595)
holmanb Aug 8, 2024
6ae8f68
doc: Describe all stages in a single process (#5595)
holmanb Aug 8, 2024
0014467
doc(boot): Make first boot a dedicated page (#5595)
holmanb Aug 8, 2024
baeb35c
doc: Add misc links, improve wording (#5595)
holmanb Aug 8, 2024
4c96055
chore(actions): add doc label for any doc related subdir file matches…
blackboxsw Aug 13, 2024
8b11d99
chore: explain other use of oauth (#5616)
aciba90 Aug 13, 2024
14edf67
docs: Drop Python 3.6 and 3.7 support (#5617)
holmanb Aug 13, 2024
07d0384
docs: Remove unnecessary section, add feature flag page (#5617)
holmanb Aug 13, 2024
dfcc2b8
fix(btrfs): Version parsing (#5618)
holmanb Aug 13, 2024
ac94539
fix(systemd): Correct location of installed drop-in files(#5615)
nmeyerhans Aug 13, 2024
19a9cca
chore(mypy): Lint log module (#5607)
holmanb Aug 7, 2024
56dc23c
chore(tox.ini): Simplify configuration, fix minor bugs (#5607)
holmanb Aug 12, 2024
2bb49b4
chore(mypy): Fix failures on newer versions of mypy (#5607)
holmanb Aug 12, 2024
56658ec
chore(black): Bump version (#5607)
holmanb Aug 12, 2024
e1845be
ci: Drop Python 3.6 and 3.7 (#5607)
holmanb Aug 12, 2024
90a3190
Update behavior of base bond interface with NetworkManager (#5385)
jcmoore3 Aug 14, 2024
d79050d
fix(nm): Ensure bond property name formatting matches schema definiti…
jcmoore3 Aug 14, 2024
bef6e5c
feat: add automation for ubuntu/* branches asserting quilt patches apply
blackboxsw Aug 14, 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
4 changes: 2 additions & 2 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ documentation:
- all:
- changed-files:
- any-glob-to-any-file:
- 'doc/*'
- 'cloudinit/config/schemas/*'
- 'doc/**'
- 'cloudinit/config/schemas/**'
- base-branch: ['main']
2 changes: 1 addition & 1 deletion .github/workflows/check_format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
matrix:
env: [ruff, mypy, pylint, black, isort]
name: Check ${{ matrix.env }}
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- name: "Checkout #1"
uses: actions/checkout@v3.0.0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cla.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Verify Contributor License Agreement
name: CLA Check

on: [pull_request]

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/labeler.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Pull Request Labeler"
name: PR Labeler
on:
- pull_request_target

Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/packaging-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Integration Tests

on:
pull_request:
branches:
- 'ubuntu/**'

concurrency:
group: 'ci-${{ github.workflow }}-${{ github.ref }}'
cancel-in-progress: true

defaults:
run:
shell: sh -ex {0}

env:
RELEASE: focal

jobs:
daily-ppa-recipe-check:
runs-on: ubuntu-22.04
steps:
- name: "Checkout"
uses: actions/checkout@v3
with:
# Fetch all branches for merging
fetch-depth: 0
- name: "Prepare dependencies"
run: |
sudo DEBIAN_FRONTEND=noninteractive apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get -y install tox quilt
- name: "Setup quilt environment"
run: |
echo 'QUILT_PATCHES=debian/patches' >> ~/.quiltrc
echo 'QUILT_SERIES=debian/patches/series' >> ~/.quiltrc

- name: 'Daily recipe: quilt patches apply successfully and tests run'
run: |
quilt push -a
tox -e py3
quilt pop -a
10 changes: 6 additions & 4 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,21 @@ jobs:
unittests:
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
toxenv: [py3]
slug: [""]
experimental: [false]
check-latest: [false]
continue-on-error: [false]
include:
- python-version: "3.6"
- python-version: "3.8"
toxenv: lowest-supported
slug: (lowest-supported)
continue-on-error: false
check-latest: false
experimental: false
name: unittest / ${{ matrix.toxenv }} / python ${{matrix.python-version}}
runs-on: ubuntu-20.04
name: Python ${{matrix.python-version}} ${{ matrix.slug }}
runs-on: ubuntu-22.04
continue-on-error: ${{ matrix.experimental }}
steps:
- name: "Checkout"
Expand Down
2 changes: 1 addition & 1 deletion cloudinit/cmd/devel/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def get_parser(parser=None):
make_mime.handle_args,
),
]
for (subcmd, helpmsg, get_parser, handler) in subcmds:
for subcmd, helpmsg, get_parser, handler in subcmds:
parser = subparsers.add_parser(subcmd, help=helpmsg)
get_parser(parser)
parser.set_defaults(action=(subcmd, handler))
Expand Down
21 changes: 16 additions & 5 deletions cloudinit/cmd/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -949,14 +949,17 @@ def main(sysv_args=None):
"--debug",
"-d",
action="store_true",
help="Show additional pre-action logging (default: %(default)s).",
help=(
"DEPRECATED: Show additional pre-action "
"logging (default: %(default)s)."
),
default=False,
)
parser.add_argument(
"--force",
action="store_true",
help=(
"Force running even if no datasource is"
"DEPRECATED: Force running even if no datasource is"
" found (use at your own risk)."
),
dest="force",
Expand All @@ -979,7 +982,10 @@ def main(sysv_args=None):

# Each action and its sub-options (if any)
parser_init = subparsers.add_parser(
"init", help="Initialize cloud-init and perform initial modules."
"init",
help=(
"DEPRECATED: Initialize cloud-init and perform initial modules."
),
)
parser_init.add_argument(
"--local",
Expand All @@ -1002,7 +1008,8 @@ def main(sysv_args=None):

# These settings are used for the 'config' and 'final' stages
parser_mod = subparsers.add_parser(
"modules", help="Activate modules using a given configuration key."
"modules",
help=("DEPRECATED: Activate modules using a given configuration key."),
)
extra_help = lifecycle.deprecate(
deprecated="`init`",
Expand Down Expand Up @@ -1033,7 +1040,11 @@ def main(sysv_args=None):

# This subcommand allows you to run a single module
parser_single = subparsers.add_parser(
"single", help="Run a single module."
"single",
help=(
"Manually run a single module. Useful for "
"testing during development."
),
)
parser_single.add_argument(
"--name",
Expand Down
1 change: 1 addition & 0 deletions cloudinit/config/cc_ansible.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""ansible enables running on first boot either ansible-pull"""

import abc
import logging
import os
Expand Down
6 changes: 2 additions & 4 deletions cloudinit/config/cc_growpart.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,10 @@ def __init__(self, distro: Distro):
self._distro = distro

@abstractmethod
def available(self, devices: list) -> bool:
...
def available(self, devices: list) -> bool: ...

@abstractmethod
def resize(self, diskdev, partnum, partdev, fs):
...
def resize(self, diskdev, partnum, partdev, fs): ...


class ResizeGrowPart(Resizer):
Expand Down
4 changes: 2 additions & 2 deletions cloudinit/config/cc_phone_home.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def handle(name: str, cfg: Config, cloud: Cloud, args: list) -> None:
"pub_key_ed25519": "/etc/ssh/ssh_host_ed25519_key.pub",
}

for (n, path) in pubkeys.items():
for n, path in pubkeys.items():
try:
all_keys[n] = util.load_text_file(path)
except Exception:
Expand All @@ -117,7 +117,7 @@ def handle(name: str, cfg: Config, cloud: Cloud, args: list) -> None:

# Get them read to be posted
real_submit_keys = {}
for (k, v) in submit_keys.items():
for k, v in submit_keys.items():
if v is None:
real_submit_keys[k] = "N/A"
else:
Expand Down
7 changes: 5 additions & 2 deletions cloudinit/config/cc_resizefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ def _resize_btrfs(mount_point, devpth):
# the resize operation can be queued
btrfs_with_queue = lifecycle.Version.from_str("5.10")
system_btrfs_ver = lifecycle.Version.from_str(
subp.subp(["btrfs", "--version"])[0].split("v")[-1].strip()
subp.subp(["btrfs", "--version"])
.stdout.split("\n")[0]
.split("v")[-1]
.strip()
)
if system_btrfs_ver >= btrfs_with_queue:
idx = cmd.index("resize")
Expand Down Expand Up @@ -290,7 +293,7 @@ def handle(name: str, cfg: Config, cloud: Cloud, args: list) -> None:
return

fstype_lc = fs_type.lower()
for (pfix, root_cmd) in RESIZE_FS_PREFIXES_CMDS:
for pfix, root_cmd in RESIZE_FS_PREFIXES_CMDS:
if fstype_lc.startswith(pfix):
resizer = root_cmd
break
Expand Down
2 changes: 1 addition & 1 deletion cloudinit/config/cc_ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def handle(name: str, cfg: Config, cloud: Cloud, args: list) -> None:
if "ssh_keys" in cfg:
# if there are keys and/or certificates in cloud-config, use them
cert_config = []
for (key, val) in cfg["ssh_keys"].items():
for key, val in cfg["ssh_keys"].items():
if key not in CONFIG_KEY_TO_FILE:
if pattern_unsupported_config_keys.match(key):
reason = "unsupported"
Expand Down
2 changes: 1 addition & 1 deletion cloudinit/config/cc_ssh_authkey_fingerprints.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def handle(name: str, cfg: Config, cloud: Cloud, args: list) -> None:

hash_meth = util.get_cfg_option_str(cfg, "authkey_hash", "sha256")
(users, _groups) = ug_util.normalize_users_groups(cfg, cloud.distro)
for (user_name, _cfg) in users.items():
for user_name, _cfg in users.items():
if _cfg.get("no_create_home") or _cfg.get("system"):
LOG.debug(
"Skipping printing of ssh fingerprints for user '%s' because "
Expand Down
2 changes: 1 addition & 1 deletion cloudinit/config/cc_ssh_import_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def handle(name: str, cfg: Config, cloud: Cloud, args: list) -> None:
# import for cloudinit created users
(users, _groups) = ug_util.normalize_users_groups(cfg, cloud.distro)
elist = []
for (user, user_cfg) in users.items():
for user, user_cfg in users.items():
import_ids = []
if user_cfg["default"]:
import_ids = util.get_cfg_option_list(cfg, "ssh_import_id", [])
Expand Down
4 changes: 2 additions & 2 deletions cloudinit/config/cc_users_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ def handle(name: str, cfg: Config, cloud: Cloud, args: list) -> None:
(default_user, _user_config) = ug_util.extract_default(users)
cloud_keys = cloud.get_public_ssh_keys() or []

for (name, members) in groups.items():
for name, members in groups.items():
cloud.distro.create_group(name, members)

for (user, config) in users.items():
for user, config in users.items():

no_home = [key for key in NO_HOME if config.get(key)]
need_home = [key for key in NEED_HOME if config.get(key)]
Expand Down
2 changes: 1 addition & 1 deletion cloudinit/config/cc_write_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def write_files(name, files, owner: str, ssl_details: Optional[dict] = None):
if not files:
return

for (i, f_info) in enumerate(files):
for i, f_info in enumerate(files):
path = f_info.get("path")
if not path:
LOG.warning(
Expand Down
8 changes: 4 additions & 4 deletions cloudinit/config/cc_yum_add_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def _format_repository_config(repo_id, repo_config):
to_be = ConfigParser()
to_be.add_section(repo_id)
# Do basic translation of the items -> values
for (k, v) in repo_config.items():
for k, v in repo_config.items():
# For now assume that people using this know
# the format of yum and don't verify keys/values further
to_be.set(repo_id, k, _format_repo_value(v))
Expand All @@ -114,7 +114,7 @@ def handle(name: str, cfg: Config, cloud: Cloud, args: list) -> None:
)
repo_locations = {}
repo_configs = {}
for (repo_id, repo_config) in repos.items():
for repo_id, repo_config in repos.items():
canon_repo_id = _canonicalize_id(repo_id)
repo_fn_pth = os.path.join(repo_base_path, "%s.repo" % (canon_repo_id))
if os.path.exists(repo_fn_pth):
Expand All @@ -135,7 +135,7 @@ def handle(name: str, cfg: Config, cloud: Cloud, args: list) -> None:
repo_config = {}
# Do some basic sanity checks/cleaning
n_repo_config = {}
for (k, v) in repo_config.items():
for k, v in repo_config.items():
k = k.lower().strip().replace("-", "_")
if k:
n_repo_config[k] = v
Expand All @@ -157,7 +157,7 @@ def handle(name: str, cfg: Config, cloud: Cloud, args: list) -> None:
repo_configs[canon_repo_id] = repo_config
repo_locations[canon_repo_id] = repo_fn_pth

for (c_repo_id, path) in repo_locations.items():
for c_repo_id, path in repo_locations.items():
repo_blob = _format_repository_config(
c_repo_id, repo_configs.get(c_repo_id)
)
Expand Down
4 changes: 2 additions & 2 deletions cloudinit/config/cc_zypper_add_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def _format_repository_config(repo_id, repo_config):
to_be = configobj.ConfigObj()
to_be[repo_id] = {}
# Do basic translation of the items -> values
for (k, v) in repo_config.items():
for k, v in repo_config.items():
# For now assume that people using this know the format
# of zypper repos and don't verify keys/values further
to_be[repo_id][k] = _format_repo_value(v)
Expand Down Expand Up @@ -115,7 +115,7 @@ def _write_repos(repos, repo_base_path):

valid_repos[repo_id] = (repo_fn_pth, repo_config)

for (repo_id, repo_data) in valid_repos.items():
for repo_id, repo_data in valid_repos.items():
repo_blob = _format_repository_config(repo_id, repo_data[-1])
util.write_file(repo_data[0], repo_blob)

Expand Down
10 changes: 4 additions & 6 deletions cloudinit/config/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@
)

try:
from jsonschema import ValidationError as _ValidationError

ValidationError = _ValidationError
from jsonschema import ValidationError
except ImportError:
ValidationError = Exception # type: ignore

Expand Down Expand Up @@ -1559,9 +1557,9 @@ def get_meta_doc(meta: MetaSchema, schema: Optional[dict] = None) -> str:
LOG.warning("Unable to render property_doc due to invalid schema")
meta_copy["property_doc"] = ""
if not meta_copy.get("property_doc", ""):
meta_copy[
"property_doc"
] = " No schema definitions for this module"
meta_copy["property_doc"] = (
" No schema definitions for this module"
)
meta_copy["examples"] = textwrap.indent(_get_examples(meta), " ")
if not meta_copy["examples"]:
meta_copy["examples"] = " No examples for this module"
Expand Down
4 changes: 2 additions & 2 deletions cloudinit/distros/aosc.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def package_command(self, command, args=None, pkgs=None):
def install_packages(self, pkglist: PackageList):
self.package_command("install", pkgs=pkglist)

def update_package_sources(self):
def update_package_sources(self, *, force=False):
self._runner.run(
"update-sources",
self.package_command,
Expand All @@ -131,7 +131,7 @@ def update_locale_conf(sys_path, locale_cfg):
return
(exists, contents) = read_locale_conf(sys_path)
updated_am = 0
for (k, v) in locale_cfg.items():
for k, v in locale_cfg.items():
if v is None:
continue
v = str(v)
Expand Down
3 changes: 1 addition & 2 deletions cloudinit/distros/package_management/package_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ def available(self) -> bool:
"""Return if package manager is installed on system."""

@abstractmethod
def update_package_sources(self, *, force=False):
...
def update_package_sources(self, *, force=False): ...

@abstractmethod
def install_packages(self, pkglist: Iterable) -> UninstalledPackages:
Expand Down
Loading
Loading