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

DLPX-92326 Fix merge conflict after upgrading cloud-init for LTS upgrade #91

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
26 changes: 20 additions & 6 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
<!--
Thank you for submitting a PR to cloud-init!
To ease the process of reviewing your PR, do make sure to complete the following checklist **before** submitting a pull request.
- [ ] I have signed the CLA: https://ubuntu.com/legal/contributors
- [ ] I have added my Github username to ``tools/.github-cla-signers``
- [ ] I have included a comprehensive commit message using the guide below
- [ ] I have added unit tests to cover the new behavior under ``tests/unittests/``
- Test files should map to source files i.e. a source file ``cloudinit/example.py`` should be tested by ``tests/unittests/test_example.py``
- Run unit tests with ``tox -e py3``
- [ ] I have kept the change small, avoiding unnecessary whitespace or non-functional changes.
- [ ] I have added a reference to issues that this PR relates to in the PR message (Refs GH-1234, Fixes GH-1234)
- [ ] I have updated the documentation with the changed behavior.
- If the change doesn't change the user interface and is trivial, this step may be skipped.
- Cloud-config documentation is generated from the jsonschema.
- Generate docs with ``tox -e docs``.
-->


## Proposed Commit Message
<!-- Include a proposed commit message because PRs are squash merged
by default.
Expand Down Expand Up @@ -34,12 +54,6 @@ this is a bug fix) this change on a live deployed system,
including any necessary configuration files, user-data,
setup, and teardown. Scripts used may be attached directly to this PR. -->

## Checklist
<!-- Go over all the following points, and put an `x` in all the boxes
that apply. -->
- [ ] My code follows the process laid out in [the documentation](https://cloudinit.readthedocs.io/en/latest/development/index.html)
- [ ] I have updated or added any [unit tests](https://cloudinit.readthedocs.io/en/latest/development/testing.html) accordingly
- [ ] I have updated or added any [documentation](https://cloudinit.readthedocs.io/en/latest/development/contribute_docs.html) accordingly

## Merge type

Expand Down
7 changes: 6 additions & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
documentation:
- doc/*
- all:
- changed-files:
- any-glob-to-any-file:
- 'doc/**'
- 'cloudinit/config/schemas/**'
- base-branch: ['main']
74 changes: 74 additions & 0 deletions .github/workflows/alpine-unittests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@

name: Alpine Unittests

on:
pull_request:
branches-ignore:
- 'ubuntu/**'
push:
branches:
- main

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

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

jobs:
build:
runs-on: ubuntu-latest
steps:

- name: "Checkout"
uses: actions/checkout@v4
with:
# Fetch all tags for tools/read-version
fetch-depth: 0

- name: Setup LXD
uses: canonical/setup-lxd@v0.1.1
with:
channel: latest/candidate

- name: Create alpine container
# the current shell doesn't have lxd as one of the groups
# so switch groups to run lxd commands
run: lxc launch images:alpine/edge alpine

- name: Check networking (for debugging)
run: |
lxc exec alpine -- ping -c 1 google.com || true
lxc exec alpine -- ping -c 1 dl-cdn.alpinelinux.org || true
lxc exec alpine -- nslookup www.google.com || true
lxc exec alpine -- ping -c 1 dl-cdn.alpinelinux.org || true
- name: Install dependencies
run: lxc exec alpine -- apk add py3-tox git tzdata

- name: Mount source into container directory
run: lxc config device add alpine gitdir disk source=$(pwd) path=/root/cloud-init-ro

- name: Create a r/w directory to run tests in
# without this, tox fails during package install
run: |
lxc exec alpine -- git config --global --add safe.directory /root/cloud-init-ro/.git
lxc exec alpine -- git clone cloud-init-ro cloud-init-rw
- name: Set a timezone
# test for regression of GH-5158
# https://github.com/canonical/cloud-init/issues/5158
run: lxc exec alpine -- ln -s /usr/share/zoneinfo/Europe/Brussels /etc/localtime

- name: Set up tox environment
# Setup the environment and then tell pytest to do essentially nothing
run: lxc exec alpine --cwd /root/cloud-init-rw -- tox -e py3 -- --cache-show=

- name: Stop network
# Take down network interfaces to ensure tests don't use network
run: lxc exec alpine -- ifdown -a

- name: Run unittests
run: lxc exec alpine --cwd /root/cloud-init-rw -- tox -e py3
14 changes: 2 additions & 12 deletions .github/workflows/check_format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,8 @@ jobs:
fail-fast: false
matrix:
env: [ruff, mypy, pylint, black, isort]
lint-with:
- {tip-versions: false, os: ubuntu-20.04}
- {tip-versions: true, os: ubuntu-latest}
name: Check ${{ matrix.lint-with.tip-versions && 'tip-' || '' }}${{ matrix.env }}
runs-on: ${{ matrix.lint-with.os }}
name: Check ${{ matrix.env }}
runs-on: ubuntu-24.04
steps:
- name: "Checkout #1"
uses: actions/checkout@v3.0.0
Expand All @@ -41,17 +38,10 @@ jobs:
run: python3 --version

- name: Test
if: ${{ !matrix.lint-with.tip-versions }}
env:
# matrix env: not to be confused w/environment variables or testenv
TOXENV: ${{ matrix.env }}
run: tox
- name: Test (tip versions)
if: matrix.lint-with.tip-versions
continue-on-error: true
env:
TOXENV: tip-${{ matrix.env }}
run: tox
schema-format:
strategy:
fail-fast: false
Expand Down
12 changes: 0 additions & 12 deletions .github/workflows/doc-autolabel.yml

This file was deleted.

9 changes: 9 additions & 0 deletions .github/workflows/labeler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: PR Labeler
on:
- pull_request_target

jobs:
labeler:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v5
18 changes: 6 additions & 12 deletions .github/workflows/linkcheck.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
name: linkcheck in CI

name: scheduled-linkcheck
on:
push:
branches:
- main
pull_request: {}
workflow_dispatch:
inputs:
failOnError:
description: 'Fail job on link check error'
required: false
default: 'false'
schedule:
- cron: '3 14 * * *'
concurrency:
group: 'ci-${{ github.workflow }}-${{ github.ref }}'
cancel-in-progress: true

jobs:
linkcheck:
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/packaging-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Packaging 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:
check-patches:
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: |
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
git remote add upstream https://git.launchpad.net/cloud-init
git fetch upstream main
git checkout upstream/main
git merge ${{ github.sha }}
quilt push -a
tox -e py3
quilt pop -a
49 changes: 38 additions & 11 deletions .github/workflows/scheduled.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
name: scheduled
name: scheduled-daily
on:
schedule:
- cron: '3 14 * * *'
concurrency:
group: 'ci-${{ github.workflow }}-${{ github.ref }}'
cancel-in-progress: true
cancel-in-progress: false

jobs:
unittests:
strategy:
matrix:
toxenv: [ hypothesis-slow ]
name: unittest / ${{ matrix.toxenv }}
hypothesis:
name: unittest / hypothesis-slow
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
# Fetch all tags for tools/read-version
fetch-depth: 0
- name: Install dependencies
env:
DEBIAN_FRONTEND: noninteractive
Expand All @@ -29,4 +23,37 @@ jobs:
env:
PYTEST_ADDOPTS: -v
HYPOTHESIS_PROFILE: ci
run: tox -e ${{ matrix.toxenv }}
run: tox -e hypothesis-slow
devel_tests:
name: unittest / 3.13-dev
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Python 3.13-dev
uses: actions/setup-python@v4
with:
python-version: 3.13-dev
check-latest: true
- name: Install tox
run: pip install tox
- name: Run unittest
run: tox -e py3
format_tip:
strategy:
fail-fast: false
matrix:
env: [tip-ruff, tip-mypy, tip-pylint, tip-black, tip-isort]
name: format-tip
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt-get -qy update
sudo apt-get -qy install tox
- name: Run Linters tip
env:
TOXENV: ${{ matrix.env }}
run: tox
15 changes: 6 additions & 9 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +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
- python-version: "3.13-dev"
toxenv: py3
check-latest: true
experimental: true
continue-on-error: true
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 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ cloud-init_*.buildinfo
cloud-init_*.changes
cloud-init_*.deb
cloud-init_*.dsc
cloud-init_*.orig.tar.gz
cloud-init_*.tar.gz
cloud-init_*.tar.xz
cloud-init_*.upload

Expand Down
23 changes: 4 additions & 19 deletions .pc/applied-patches
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
retain-apt-partner-pocket.patch
expire-on-hashed-users.patch
retain-netplan-world-readable.patch
netplan99-cannot-use-default.patch
retain-old-groups.patch
keep-dhclient-as-priority-client.patch
revert-551f560d-cloud-config-after-snap-seeding.patch
do-not-block-user-login.patch
status-do-not-remove-duplicated-data.patch
retain-apt-pre-deb822.patch
status-retain-recoverable-error-exit-code.patch
retain-ec2-default-net-update-events.patch
cpick-a6f7577d-bug-package_update-avoid-snap-refresh-in-images-without
cli-retain-file-argument-as-main-cmd-arg.patch
cpick-51c6569f-fix-snapd-ubuntu-do-not-snap-refresh-when-snap-absent
cpick-417ee551-fix-ec2-Ensure-metadata-exists-before-configuring-PBR
cpick-d6776632-fix-Check-renderer-for-netplan-specific-code-5321
cpick-74dc7cce-test-Fix-failing-test_ec2.py-test-5324
cpick-d771d1f4-fix-ec2-Correctly-identify-netplan-renderer-5361
deprecation-version-boundary.patch
no-single-process.patch
no-nocloud-network.patch
cpick-hotplugd-systemd-ordering-fix.patch
Loading
Loading