Skip to content

funfedi_results

FeatureResult dataclass

FeatureResult(name: str, status: str, tags: list[str], start: int, attachments: dict[str, str])

Parameters:

Name Type Description Default
name str
required
status str
required
tags list[str]
required
start int
required
attachments dict[str, str]
required
Source code in funfedi_results/archive/types.py
@dataclass
class FeatureResult:
    name: str
    status: str
    tags: list[str]
    start: int
    attachments: dict[str, str]

    @staticmethod
    def from_data(data: dict):
        name = data.get("fullName", "-- missing --")
        status = data.get("status", "-- missing --")
        tags = [
            x.get("value", "") for x in data.get("labels", []) if x.get("name") == "tag"
        ]
        attachments = {}
        for step in data.get("steps", []):
            for attachment in step.get("attachments", []):
                a = attachment.get("source")
                a_name = attachment.get("name")
                if a and a_name:
                    attachments[a_name] = a.removesuffix("-attachment.json")

        return FeatureResult(
            name, status, tags, start=data.get("start", 0), attachments=attachments
        )

LoadedResult dataclass

LoadedResult(containers: list[dict], results: list[dict], attachments: dict[str, dict])

Parameters:

Name Type Description Default
containers list[dict]
required
results list[dict]
required
attachments dict[str, dict]
required
Source code in funfedi_results/archive/types.py
@dataclass
class LoadedResult:
    containers: list[dict]
    results: list[dict]
    attachments: dict[str, dict]