From b1d859f5262917e15407be730574b94f5ba068ba Mon Sep 17 00:00:00 2001 From: Kevin Dinkel Date: Mon, 20 Nov 2023 09:56:33 -0700 Subject: [PATCH 1/3] removing security tokens from github actions --- .github/workflows/build_user_guide.yml | 3 --- .github/workflows/publish_all.yml | 3 --- .github/workflows/style_all.yml | 3 --- .github/workflows/test_all.yml | 3 --- 4 files changed, 12 deletions(-) diff --git a/.github/workflows/build_user_guide.yml b/.github/workflows/build_user_guide.yml index ca3b9734..45f6627d 100644 --- a/.github/workflows/build_user_guide.yml +++ b/.github/workflows/build_user_guide.yml @@ -10,9 +10,6 @@ jobs: runs-on: ubuntu-latest container: image: dinkelk/adamant:example-latest - credentials: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} env: INSTALL_DIR: /home/user/env ADAMANT_DIR: ${{ github.workspace }} diff --git a/.github/workflows/publish_all.yml b/.github/workflows/publish_all.yml index f037d5e5..c2debc98 100644 --- a/.github/workflows/publish_all.yml +++ b/.github/workflows/publish_all.yml @@ -10,9 +10,6 @@ jobs: runs-on: ubuntu-latest container: image: dinkelk/adamant:example-latest - credentials: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} env: INSTALL_DIR: /home/user/env ADAMANT_DIR: ${{ github.workspace }} diff --git a/.github/workflows/style_all.yml b/.github/workflows/style_all.yml index 02e19ae8..176d3da5 100644 --- a/.github/workflows/style_all.yml +++ b/.github/workflows/style_all.yml @@ -10,9 +10,6 @@ jobs: runs-on: ubuntu-latest container: image: dinkelk/adamant:example-latest - credentials: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} env: INSTALL_DIR: /home/user/env ADAMANT_DIR: ${{ github.workspace }} diff --git a/.github/workflows/test_all.yml b/.github/workflows/test_all.yml index 506d788c..02d3993d 100644 --- a/.github/workflows/test_all.yml +++ b/.github/workflows/test_all.yml @@ -10,9 +10,6 @@ jobs: runs-on: ubuntu-latest container: image: dinkelk/adamant:example-latest - credentials: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} env: INSTALL_DIR: /home/user/env ADAMANT_DIR: ${{ github.workspace }} From b1366969abc17a84f43b376045f3f2f1dca5c4d3 Mon Sep 17 00:00:00 2001 From: Kevin Dinkel Date: Mon, 20 Nov 2023 11:10:59 -0700 Subject: [PATCH 2/3] updating actions to use github container instead of dockerhub --- .github/workflows/build_user_guide.yml | 2 +- .github/workflows/publish_all.yml | 2 +- .github/workflows/style_all.yml | 2 +- .github/workflows/test_all.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_user_guide.yml b/.github/workflows/build_user_guide.yml index 45f6627d..5333524c 100644 --- a/.github/workflows/build_user_guide.yml +++ b/.github/workflows/build_user_guide.yml @@ -9,7 +9,7 @@ jobs: name: build_user_guide runs-on: ubuntu-latest container: - image: dinkelk/adamant:example-latest + image: ghcr.io/lasp/adamant:example-latest env: INSTALL_DIR: /home/user/env ADAMANT_DIR: ${{ github.workspace }} diff --git a/.github/workflows/publish_all.yml b/.github/workflows/publish_all.yml index c2debc98..1dd2e283 100644 --- a/.github/workflows/publish_all.yml +++ b/.github/workflows/publish_all.yml @@ -9,7 +9,7 @@ jobs: name: publish_all runs-on: ubuntu-latest container: - image: dinkelk/adamant:example-latest + image: ghcr.io/lasp/adamant:example-latest env: INSTALL_DIR: /home/user/env ADAMANT_DIR: ${{ github.workspace }} diff --git a/.github/workflows/style_all.yml b/.github/workflows/style_all.yml index 176d3da5..15ab2ac1 100644 --- a/.github/workflows/style_all.yml +++ b/.github/workflows/style_all.yml @@ -9,7 +9,7 @@ jobs: name: style_all runs-on: ubuntu-latest container: - image: dinkelk/adamant:example-latest + image: ghcr.io/lasp/adamant:example-latest env: INSTALL_DIR: /home/user/env ADAMANT_DIR: ${{ github.workspace }} diff --git a/.github/workflows/test_all.yml b/.github/workflows/test_all.yml index 02d3993d..662ba61f 100644 --- a/.github/workflows/test_all.yml +++ b/.github/workflows/test_all.yml @@ -9,7 +9,7 @@ jobs: name: test_all runs-on: ubuntu-latest container: - image: dinkelk/adamant:example-latest + image: ghcr.io/lasp/adamant:example-latest env: INSTALL_DIR: /home/user/env ADAMANT_DIR: ${{ github.workspace }} From 706ae17745b73fd450e128293baf8148805ef2c5 Mon Sep 17 00:00:00 2001 From: Kevin Dinkel Date: Mon, 20 Nov 2023 11:20:36 -0700 Subject: [PATCH 3/3] fixing deprecated pattern ruamel yaml loader --- gen/models/base.py | 3 ++- gen/models/exceptions.py | 2 +- redo/bin/yaml_sloc_counter.py | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/gen/models/base.py b/gen/models/base.py index 39db7473..435eeb5b 100644 --- a/gen/models/base.py +++ b/gen/models/base.py @@ -262,7 +262,8 @@ def _loadYaml(yaml_text): warnings.simplefilter("ignore", yaml.error.UnsafeLoaderWarning) # with open(self.full_filename, 'r') as stream: try: - return yaml.load(yaml_text, Loader=yaml.RoundTripLoader) + yml = yaml.YAML(typ='rt') + return yml.load(yaml_text) # import sys # sys.stderr.write(str(self.data) + "\n") # sys.stderr.write(str(type(self.data)) + "\n") diff --git a/gen/models/exceptions.py b/gen/models/exceptions.py index 2ff85a7c..de937f1e 100644 --- a/gen/models/exceptions.py +++ b/gen/models/exceptions.py @@ -36,7 +36,7 @@ def inner(*args, **kwargs): # Decorator which catches a model exception and addes # a line number if the argument of the function contains # an attribue "lc.line" which is the line number attribute -# of a rout trip loaded yaml dictionary from ruamel.yaml +# of a round trip loaded yaml dictionary from ruamel.yaml def throw_exception_with_lineno(func): def inner(*args, **kwargs): try: diff --git a/redo/bin/yaml_sloc_counter.py b/redo/bin/yaml_sloc_counter.py index dbbddaa2..8a951a6d 100755 --- a/redo/bin/yaml_sloc_counter.py +++ b/redo/bin/yaml_sloc_counter.py @@ -14,7 +14,8 @@ def _loadYaml(yaml_text): import warnings warnings.simplefilter("ignore", yaml.error.UnsafeLoaderWarning) - return yaml.load(yaml_text, Loader=yaml.RoundTripLoader) + yml = yaml.YAML(typ='rt') + return yml.load(yaml_text) # Open and read the yaml file: with open(yaml_file, "r") as f: