Skip to content

Commit

Permalink
Merge pull request #417 from crocs-muni/fix/fips-alg-nums
Browse files Browse the repository at this point in the history
Fix FIPS pipeline for new certs.
  • Loading branch information
J08nY authored Jun 20, 2024
2 parents 394755d + 3c0392f commit 2bbb3fb
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 15 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: "pip"
cache-dependency-path: |
requirements/dev_requirements.txt
- name: apt-get update
run: sudo apt-get update
- name: Install external dependencies
Expand Down
13 changes: 4 additions & 9 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,9 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: apt-get update
run: sudo apt-get update
- name: Install dependencies
run: |
sudo apt-get install build-essential libpoppler-cpp-dev pkg-config python3-dev -y
pip install -r requirements/dev_requirements.txt
- name: Run pre-commit
run: pre-commit run --all-files
- uses: pre-commit/[email protected]
with:
extra_args: --all-files
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: apt-get update
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
run: sudo apt-get install -y build-essential libpoppler-cpp-dev pkg-config python3-dev
- uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: "pip"
Expand Down
2 changes: 1 addition & 1 deletion src/sec_certs/model/references_nlp/annotator.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,6 @@ def predict_df(self, df: pd.DataFrame) -> pd.DataFrame:
df_new["y_proba"] = y_proba
df_new["y_pred"] = self.predict(df_new.segments)
df_new["correct"] = df_new.apply(
lambda row: row["y_pred"] == row["label"] if not pd.isnull(row["label"]) else np.NaN, axis=1
lambda row: row["y_pred"] == row["label"] if not pd.isnull(row["label"]) else np.nan, axis=1
)
return df_new
2 changes: 1 addition & 1 deletion src/sec_certs/sample/fips.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ def algorithm_numbers(self) -> set[str]:
def alg_to_number(alg: str) -> str:
return "".join([x for x in alg.split("#")[1] if x.isdigit()])

return {alg_to_number(x) for x in self.algorithms}
return {alg_to_number(x) for x in self.algorithms if "#" in x}

@property
def dgst(self) -> str:
Expand Down
2 changes: 1 addition & 1 deletion src/sec_certs/utils/pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def compute_cve_correlations(
spearmanr = functools.partial(stats.spearmanr, nan_policy="omit", alternative="less")

df_sar.eal = df_sar.eal.cat.codes
df_sar.eal = df_sar.eal.map(lambda x: np.NaN if x == -1 else x)
df_sar.eal = df_sar.eal.map(lambda x: np.nan if x == -1 else x)

n_cves_eal_corr, n_cves_eal_pvalue = spearmanr(df_sar.eal, df_sar.n_cves)
n_cves_corrs = [n_cves_eal_corr]
Expand Down

0 comments on commit 2bbb3fb

Please sign in to comment.