From b7454a829b18a6de085bf9e78d4ddd2dfcf8a30a Mon Sep 17 00:00:00 2001 From: Michal Czyz Date: Tue, 29 Aug 2023 13:23:11 +0200 Subject: [PATCH 1/4] Correct path for PR remove --- .github/workflows/gh-pages-pr-remove.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gh-pages-pr-remove.yml b/.github/workflows/gh-pages-pr-remove.yml index 7c5daf3918d..2d567093fb7 100644 --- a/.github/workflows/gh-pages-pr-remove.yml +++ b/.github/workflows/gh-pages-pr-remove.yml @@ -7,7 +7,7 @@ on: - completed env: - ROOT_DIR: './public' + ROOT_DIR: './public.old' jobs: remove: @@ -51,5 +51,5 @@ jobs: uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ${{ env.ROOT_DIR }} + publish_dir: ./public.new commit_message: "Remove reports from PR#${{ steps.PR.outputs.number }}" From b49fe8c3ea878925c426c113d35a00372085121c Mon Sep 17 00:00:00 2001 From: Michal Czyz Date: Tue, 29 Aug 2023 13:23:37 +0200 Subject: [PATCH 2/4] Correct path for dashboard dir replacement --- .github/scripts/update_webpage.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/scripts/update_webpage.sh b/.github/scripts/update_webpage.sh index ad467ac3fbb..17a9a2a18b5 100755 --- a/.github/scripts/update_webpage.sh +++ b/.github/scripts/update_webpage.sh @@ -62,8 +62,8 @@ update_webpage(){ fi PUBLIC_DIR=./public.old - replace_dir ./coverage_dashboard ${PUBLIC_DIR}/${DIR}/coverage_dashboard - replace_dir ./verification_dashboard ${PUBLIC_DIR}/${DIR}/verification_dashboard + replace_dir ./coverage_dashboard ${PUBLIC_DIR}/html/${DIR}/coverage_dashboard + replace_dir ./verification_dashboard ${PUBLIC_DIR}/html/${DIR}/verification_dashboard pushd .github/scripts/indexgen python -m venv venv @@ -71,6 +71,7 @@ update_webpage(){ pip install -r requirements.txt popd + make -C .github/scripts/indexgen all ROOTDIR=`realpath ./public.old` BUILDDIR=`realpath ./public.new` echo -e "${COLOR_WHITE}Makefile exit status:$?${COLOR_CLEAR}" From d974bcd2c5c2bf38134a208489174020b6acb032 Mon Sep 17 00:00:00 2001 From: Michal Czyz Date: Tue, 29 Aug 2023 17:57:58 +0200 Subject: [PATCH 3/4] Create restrictive rsync rule --- .github/scripts/indexgen/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/scripts/indexgen/Makefile b/.github/scripts/indexgen/Makefile index cb21191574e..f6704b5fc4e 100644 --- a/.github/scripts/indexgen/Makefile +++ b/.github/scripts/indexgen/Makefile @@ -16,12 +16,12 @@ $(GENDIR): $(GENDIR)/index.md: $(SOURCES) generate.py | $(GENDIR) @rm -rf $(GENDIR)/* - @python3 generate.py --template "$(SOURCEDIR)" --root "$(ROOTDIR)" --output "$(GENDIR)" + @python3 generate.py --template "$(SOURCEDIR)" --root "$(ROOTDIR)/html" --output "$(GENDIR)" # Build the final webpage. Pass the 'html' target to sphinx, copy report pages html: Makefile $(GENDIR)/index.md @$(SPHINXBUILD) -M $@ "$(GENDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - @rsync -avr "$(ROOTDIR)/" "$(BUILDDIR)/" + @rsync -avrm --include="*/" --include="coverage_dashboard/***" --include="verification_dashboard/***" --exclude="*" "$(ROOTDIR)/" "$(BUILDDIR)/" @bash update_styles.sh "$(BUILDDIR)" clean: From db3169219beb5c2f37ce43b6c7d342da98a65dd0 Mon Sep 17 00:00:00 2001 From: Michal Czyz Date: Tue, 29 Aug 2023 17:59:08 +0200 Subject: [PATCH 4/4] Add debug logging information --- .github/scripts/indexgen/generate.py | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/scripts/indexgen/generate.py b/.github/scripts/indexgen/generate.py index 0ba662c26f8..d80a3170ffb 100755 --- a/.github/scripts/indexgen/generate.py +++ b/.github/scripts/indexgen/generate.py @@ -2,7 +2,7 @@ import argparse import os import shutil - +import logging import jinja2 # ============================================================================== @@ -24,7 +24,12 @@ def make_coverage_report_index(branch, root, output, templates): """ Prepares coverage report index page """ - + logging.debug("=== make_coverage_report_index") + logging.debug(f"branch = {branch}") + logging.debug(f"root = {root}") + logging.debug(f"output = {output}") + logging.debug(f"templates = {templates}") + logging.debug("===") keys = ["all", "branch", "toggle", "functional"] path = os.path.join(root, "coverage_dashboard") @@ -76,7 +81,12 @@ def make_verification_report_index(branch, root, output, templates): """ Prepares verification tests report index page """ - + logging.debug("=== make_verification_report_index") + logging.debug(f"branch = {branch}") + logging.debug(f"root = {root}") + logging.debug(f"output = {output}") + logging.debug(f"templates = {templates}") + logging.debug("===") path = os.path.join(root, "verification_dashboard") # Collect tests @@ -108,7 +118,11 @@ def make_dev_index(branches, output, templates): """ Prepares the branch/pr index page """ - + logging.debug("=== make_dev_index") + logging.debug(f"branches = {branches}") + logging.debug(f"output = {output}") + logging.debug(f"templates = {templates}") + logging.debug("===") params = { "branches": branches, } @@ -123,6 +137,7 @@ def make_dev_index(branches, output, templates): def main(): + logging.basicConfig(encoding="utf-8", level=logging.DEBUG) # Parse args parser = argparse.ArgumentParser() @@ -169,6 +184,7 @@ def main(): # Reports for development branches / pull requests branches = [] + path = os.path.join(args.root, "dev") if os.path.isdir(path):