You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The class instances of type SetupJava, OracleSetupJava and GraalVMSetup do not have the attribute action_version. This is unexpected because action_version is inherited from the base class ThirdPartyAction
def find_language_setup_action(job_node: GitHubJobNode, lang_name: BuildLanguage) -> Language | None:
"""Find the step that calls a language setup GitHub Actions and return the model.
Parameters
----------
job_node: GitHubJobNode
The target GitHub Actions job node.
lang_name: BuildLanguage
The target language used in the build.
Returns
-------
Language | None
The language model for the language setup GitHub Action or None.
"""
for callee in job_node.callee:
model = callee.model
# Check if the model implements the Language protocol.
if isinstance(model, Language):
import pdb; pdb.set_trace()
if model.lang_name == lang_name:
return model
return None
SetupJava defines it owns constructor, which overrides the dataclass constructors generated for ThirdPartyAction. SetupJava constructor doesn't initialize action_version, hence it will never exist in any class instance.
This happens for OracleSetupJava and GraalVMSetup with the same reason.
Environment Information
To assist with troubleshooting, please provide the following information about your environment:
Operating System: Ubuntu 22.04
CPU architecture information: x84-64
Bash Version: version 5.1.16(1)-release
Running Macaron as a Python package.
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
Description
The class instances of type
SetupJava
,OracleSetupJava
andGraalVMSetup
do not have the attributeaction_version
. This is unexpected becauseaction_version
is inherited from the base classThirdPartyAction
Steps to Reproduce
Running on commit e42408a
macaron/src/macaron/slsa_analyzer/ci_service/github_actions/analyzer.py
Line 275 in 32aa0cc
For example
You will be taken into pdb
Initial investigation
This happened because of the following factors:
SetupJava
inherits fromThirdPartyAction
, which is a frozen dataclass.macaron/src/macaron/slsa_analyzer/ci_service/github_actions/analyzer.py
Lines 37 to 45 in 32aa0cc
SetupJava
doesn't set theaction_version
class attribute, instead it just annotate this attribute asNone
macaron/src/macaron/slsa_analyzer/ci_service/github_actions/analyzer.py
Line 501 in 32aa0cc
SetupJava
defines it owns constructor, which overrides the dataclass constructors generated forThirdPartyAction
.SetupJava
constructor doesn't initializeaction_version
, hence it will never exist in any class instance.OracleSetupJava
andGraalVMSetup
with the same reason.Environment Information
To assist with troubleshooting, please provide the following information about your environment:
Operating System: Ubuntu 22.04
CPU architecture information: x84-64
Bash Version: version 5.1.16(1)-release
Running Macaron as a Python package.
The text was updated successfully, but these errors were encountered: