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

DEBUG: DONTMERGE: this should trigger webui test #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/trigger-webui.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# This workflow checks if the PR affects Anaconda (changes to pyanaconda folder),
# polls the packit COPR until it has the current PR version
# available, and then test-triggers an "anaconda PR" scenario.
#
# This workflow is inspired from:
# https://github.com/cockpit-project/cockpit/blob/main/.github/workflows/trigger-anaconda.yml

name: Anaconda Web UI
on:
pull_request_target:
# only API changes might affect the Web UI
paths:
- pyanaconda/**
jobs:
trigger:
runs-on: ubuntu-22.04
# the default workflow token cannot read our org membership, for deciding who is allowed to trigger tests
environment: gh-cockpituous
container: registry.fedoraproject.org/fedora:rawhide
# this polls for a COPR build, which can take long
timeout-minutes: 120

steps:
- name: Install dependencies
run: |
dnf install -y git-core dnf-plugins-core || {
sleep 60
dnf install -y git-core dnf-plugins-core
}

# Naively this should wait for github.event.pull_request.head.sha, but
# that breaks on non-current branches, which packit merges to main with
# an unpredictable SHA; so instead, wait until COPR has a build which is
# newer than the PR push time. This assumes that this workflow always runs earlier
# than the COPR srpm build finishes.
- name: Wait for packit COPR build
run: |
set -ex
PUSH_TIME=$(date --utc +%Y%m%d%H%M%S -d '${{ github.event.pull_request.head.repo.pushed_at }}')
COPR_NAME="${{ github.event.pull_request.base.user.login }}-${{ github.event.pull_request.base.repo.name }}-${{ github.event.number }}"
for _ in $(seq 60); do
sleep 60;
if dnf copr enable -y packit/$COPR_NAME &&
out=$(dnf info --refresh --repo='copr:*anaconda*' anaconda) &&
stamp=$(echo "$out" | awk '/^Release/ { split($3, v, "."); print substr(v[2], 0, 14)}' | head -1) &&
[ "$stamp" -gt "$PUSH_TIME" ]; then
exit 0
fi
done
exit 1

- name: Trigger anaconda run
run: |
git clone --depth=1 https://github.com/cockpit-project/bots
mkdir -p ~/.config/cockpit-dev
echo '${{ secrets.COCKPITUOUS_TOKEN }}' > ~/.config/cockpit-dev/github-token
bots/tests-trigger --allow --repo ${{ github.repository }} ${{ github.event.number }} fedora-rawhide-boot/anaconda-pr-${{ github.event.number }}@rhinstaller/anaconda-webui
1 change: 1 addition & 0 deletions pyanaconda/modules/storage/devicetree/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ def set_device_passphrase(self, device_name, passphrase):
:param device_name: a name of the device
:param passphrase: a passphrase
"""
log.debug("Setting device %s passphrase", device_name)
device = self._get_device(device_name)
device.format.passphrase = passphrase
self.storage.save_passphrase(device)
Expand Down