From 44e22ab0f6c488282d322a2b572352d95f42db5b Mon Sep 17 00:00:00 2001 From: Kareem Khazem Date: Mon, 7 Mar 2022 14:32:51 +0000 Subject: [PATCH 01/13] Create version 1.22.0 release candidate --- lib/litani.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/litani.py b/lib/litani.py index 9f26c9e9..37d1f549 100644 --- a/lib/litani.py +++ b/lib/litani.py @@ -33,9 +33,9 @@ TIME_FORMAT_W = "%Y-%m-%dT%H:%M:%SZ" TIME_FORMAT_MS = "%Y-%m-%dT%H:%M:%S.%fZ" VERSION_MAJOR = 1 -VERSION_MINOR = 21 +VERSION_MINOR = 22 VERSION_PATCH = 0 -RC = False +RC = True RC_STR = "-rc" if RC else "" VERSION = "%d.%d.%d%s" % (VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH, RC_STR) From d9d2fb85ceffdd12e9562501fb7e92066178a3ad Mon Sep 17 00:00:00 2001 From: Ronak Fofaliya Date: Mon, 7 Mar 2022 10:03:21 -0500 Subject: [PATCH 02/13] Fix run-tests workflow file name --- .github/workflows/{run-tests => run-tests.yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{run-tests => run-tests.yaml} (100%) diff --git a/.github/workflows/run-tests b/.github/workflows/run-tests.yaml similarity index 100% rename from .github/workflows/run-tests rename to .github/workflows/run-tests.yaml From b39d5b028e53177eeab4c10f7f603c071faaf526 Mon Sep 17 00:00:00 2001 From: Kareem Khazem Date: Mon, 7 Mar 2022 16:08:39 +0000 Subject: [PATCH 03/13] Tell release engineer to push develop and release Previously, following the instructions would only push the release branch to origin, not the develop branch. --- script/release | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/script/release b/script/release index 9c36b8a1..4472511e 100755 --- a/script/release +++ b/script/release @@ -62,8 +62,11 @@ create-release: $(SANITY_CHECKS) $(STATE_FILES) $(RELEASE_PROCESS) $(info --- Finished) git checkout release @>&2 printf '\n```````````````````````````````````````````````````````````\n' - @>&2 printf \ - "Now run\n\n git push -u origin release\n git push origin --tags\n\n" + @>&2 printf "Now run\n\n" + @>&2 printf " git push -u origin release\n" + @>&2 printf " git checkout develop\n" + @>&2 printf " git push -u origin develop\n" + @>&2 printf " git push origin --tags\n\n" @>&2 printf '___________________________________________________________\n' .PHONY: $(SANITY_CHECKS) $(PHONY_DEPS) From 0df4e409ecaf4620b2afe9891928a96d941e9cea Mon Sep 17 00:00:00 2001 From: Ronak Fofaliya Date: Fri, 4 Mar 2022 15:37:58 -0500 Subject: [PATCH 04/13] Fix space in release script --- script/release | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/release b/script/release index 4472511e..40b75873 100755 --- a/script/release +++ b/script/release @@ -101,7 +101,7 @@ create-rc: $(TMP)/rc-number git add lib/litani.py major=$$(grep -e '^VERSION_MAJOR' lib/litani.py | head -n 1 | awk -F= '{print $$2}'); \ minor=$$(cat $(TMP)/rc-number); \ - git commit -m "Create version $${major}.$${minor} release candidate" + git commit -m "Create version$${major}.$${minor} release candidate" $(TMP)/rc-number: $(info --- Generating RC number) From bed0d2bca17862cdea4459e6e4fa72bac730c959 Mon Sep 17 00:00:00 2001 From: Ronak Fofaliya Date: Mon, 7 Mar 2022 11:49:42 -0500 Subject: [PATCH 05/13] Do not run litani tests if 'no-test' label is set --- .github/workflows/run-tests.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml index d1760504..b7cf11ab 100644 --- a/.github/workflows/run-tests.yaml +++ b/.github/workflows/run-tests.yaml @@ -1,11 +1,13 @@ name: Run Litani Tests on: pull_request: - types: [ labeled ] + types: [opened, synchronize, reopened, labeled, unlabeled] + push: + branches: [ release, develop ] jobs: test-litani: - if: ${{ github.event.label.name == 'test' }} + if: "!contains(github.event.pull_request.labels.*.name, 'no-test')" name: Run Litani Tests runs-on: macos-latest steps: From 70645cdc9e441ac7865ffe79d905296d7a52e329 Mon Sep 17 00:00:00 2001 From: Ronak Fofaliya Date: Wed, 2 Mar 2022 14:57:45 -0500 Subject: [PATCH 06/13] Cache path to cache directory Run get_cache_dir() once and save path to CacheDir.cache_dir_path variable. This results in cache_dir being calculated once per add job. Fixes #109 --- lib/litani.py | 80 ++++++++++++++++++++++++++++----------------------- 1 file changed, 44 insertions(+), 36 deletions(-) diff --git a/lib/litani.py b/lib/litani.py index 37d1f549..01c15cc6 100644 --- a/lib/litani.py +++ b/lib/litani.py @@ -14,6 +14,7 @@ import asyncio import contextlib +import dataclasses import json import logging import os @@ -67,6 +68,48 @@ class TimeoutExpired(Exception): pass +@dataclasses.dataclass +class CacheDir: + cache_dir_path: pathlib.Path = None + + @staticmethod + def get(lookup_path=os.getcwd()): + if CacheDir.cache_dir_path: + return CacheDir.cache_dir_path + def cache_pointer_dirs(): + current = pathlib.Path(lookup_path).resolve(strict=True) + yield current + while current.parent != current: + current = current.parent + yield current + + for possible_dir in cache_pointer_dirs(): + logging.debug( + "Searching for cache pointer in %s", possible_dir) + possible_pointer = possible_dir / CACHE_POINTER + try: + if possible_pointer.exists(): + logging.debug( + "Found a cache pointer at %s", possible_pointer) + with open(possible_pointer) as handle: + pointer = handle.read().strip() + possible_cache = pathlib.Path(pointer) + if possible_cache.exists(): + logging.debug("cache is at %s", possible_cache) + CacheDir.cache_dir_path = possible_cache + return possible_cache + logging.warning( + "Found a cache file at %s pointing to %s, but that " + "directory does not exist. Continuing search...", + possible_pointer, possible_cache) + except PermissionError: + pass + + logging.error( + "Could not find a pointer to a litani cache. Did you forget " + "to run `litani init`?") + raise FileNotFoundError + class LockableDirectory: """POSIX-compliant directory locking""" @@ -147,44 +190,9 @@ async def try_acquire_wait(self, timeout=0): -def _get_cache_dir(path=os.getcwd()): - def cache_pointer_dirs(): - current = pathlib.Path(path).resolve(strict=True) - yield current - while current.parent != current: - current = current.parent - yield current - - for possible_dir in cache_pointer_dirs(): - logging.debug( - "Searching for cache pointer in %s", possible_dir) - possible_pointer = possible_dir / CACHE_POINTER - try: - if possible_pointer.exists(): - logging.debug( - "Found a cache pointer at %s", possible_pointer) - with open(possible_pointer) as handle: - pointer = handle.read().strip() - possible_cache = pathlib.Path(pointer) - if possible_cache.exists(): - logging.debug("cache is at %s", possible_cache) - return possible_cache - logging.warning( - "Found a cache file at %s pointing to %s, but that " - "directory does not exist. Continuing search...", - possible_pointer, possible_cache) - except PermissionError: - pass - - logging.error( - "Could not find a pointer to a litani cache. Did you forget " - "to run `litani init`?") - raise FileNotFoundError - - def get_cache_dir(path=os.getcwd()): try: - return _get_cache_dir(path) + return CacheDir.get(path) except FileNotFoundError: sys.exit(1) From c8a927333daa8b1fa55adb29943a80845e2f6c5a Mon Sep 17 00:00:00 2001 From: Kareem Khazem Date: Thu, 10 Mar 2022 02:43:17 +0000 Subject: [PATCH 07/13] Add ids to sections on HTML dashboard Every major section on the HTML dashboard now has an "id" attribute, making it possible to link to those sections. Prior to this commit, it was not possible to link to specific graphs on the front page, for example. There is not currently any provision for retrieving those links. --- templates/dashboard.jinja.html | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/templates/dashboard.jinja.html b/templates/dashboard.jinja.html index 95bf570b..a57e6d30 100644 --- a/templates/dashboard.jinja.html +++ b/templates/dashboard.jinja.html @@ -426,7 +426,7 @@

{% for pipe in run["pipelines"] %} -
+
{% for job_desc, job in front_page_outputs.items() %} -
+

Output of job "{{ title }}

+

{{ title }}

{% for svg in svg_list %}
@@ -529,7 +533,7 @@

{{ title }}

{% endfor -%}{# title, svg_list in svgs #} -

Downloads

+

Downloads

  • @@ -549,7 +553,7 @@

    Downloads

-