Skip to content

Remove compliance summary os id #427

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

import artefacts
import compliance_tests
import compliance_summary as cs
import components
import consts
import ctx_util
Expand All @@ -36,7 +35,6 @@
import service_extensions
import special_component
import sprint
import util


ci.log.configure_default_logging(print_thread_id=True)
Expand Down Expand Up @@ -140,10 +138,6 @@ def add_app_context_vars(
addressbook_github_mappings = []
addressbook_source = None

artefact_metadata_cfg_by_type = cs.artefact_metadata_cfg_by_type(
artefact_metadata_cfg=util.parse_yaml_file(paths.artefact_metadata_cfg),
)

component_with_tests_callback = features.get_feature(
features.FeatureTests,
).get_component_with_tests
Expand Down Expand Up @@ -193,7 +187,6 @@ def add_app_context_vars(
app[consts.APP_ADDRESSBOOK_ENTRIES] = addressbook_entries
app[consts.APP_ADDRESSBOOK_GITHUB_MAPPINGS] = addressbook_github_mappings
app[consts.APP_ADDRESSBOOK_SOURCE] = addressbook_source
app[consts.APP_ARTEFACT_METADATA_CFG] = artefact_metadata_cfg_by_type
app[consts.APP_BASE_URL] = base_url
app[consts.APP_COMPONENT_DESCRIPTOR_LOOKUP] = component_descriptor_lookup
app[consts.APP_COMPONENT_WITH_TESTS_CALLBACK] = component_with_tests_callback
Expand Down Expand Up @@ -292,11 +285,6 @@ def add_routes(
handler=components.ComplianceSummary,
)

app.router.add_view(
path='/components/metadata',
handler=components.ComponentMetadata,
)

app.router.add_view(
path='/delivery/sprint-infos',
handler=sprint.SprintInfos,
Expand Down
22 changes: 0 additions & 22 deletions cache_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,12 @@
import ctx_util
import deliverydb
import deliverydb.model as dm
import eol
import k8s.logging
import k8s.model
import k8s.util
import lookups
import odg.extensions_cfg
import odg.findings
import paths
import util


logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -139,9 +136,7 @@ def interval_min(column: sqlalchemy.DateTime) -> sqlalchemy.sql.elements.BinaryE
async def prefill_compliance_summary_cache(
component_id: ocm.ComponentIdentity,
component_descriptor_lookup: cnudie.retrieve_async.ComponentDescriptorLookupById,
eol_client: eol.EolClient,
finding_cfgs: collections.abc.Sequence[odg.findings.Finding],
artefact_metadata_cfg_by_type: dict[str, compliance_summary.ArtefactMetadataCfg],
db_session: sqlasync.session.AsyncSession,
):
logger.info(f'Updating compliance summary for {component_id.name}:{component_id.version}')
Expand All @@ -154,8 +149,6 @@ async def prefill_compliance_summary_cache(
datasource=dso.model.Datatype.datatype_to_datasource(finding_cfg.type),
db_session=db_session,
component_descriptor_lookup=component_descriptor_lookup,
eol_client=eol_client,
artefact_metadata_cfg=artefact_metadata_cfg_by_type.get(finding_cfg.type),
)


Expand All @@ -164,9 +157,7 @@ async def prefill_compliance_summary_caches(
component_descriptor_lookup: cnudie.retrieve_async.ComponentDescriptorLookupById,
version_lookup: cnudie.retrieve_async.VersionLookupByComponent,
oci_client: oci.client_async.Client,
eol_client: eol.EolClient,
finding_cfgs: collections.abc.Sequence[odg.findings.Finding],
artefact_metadata_cfg_by_type: dict[str, compliance_summary.ArtefactMetadataCfg],
invalid_semver_ok: bool,
db_session: sqlasync.session.AsyncSession,
):
Expand Down Expand Up @@ -211,9 +202,7 @@ async def prefill_compliance_summary_caches(
await prefill_compliance_summary_cache(
component_id=component_id,
component_descriptor_lookup=component_descriptor_lookup,
eol_client=eol_client,
finding_cfgs=finding_cfgs,
artefact_metadata_cfg_by_type=artefact_metadata_cfg_by_type,
db_session=db_session,
)

Expand All @@ -238,9 +227,7 @@ async def prefill_function_caches(
component_descriptor_lookup: cnudie.retrieve_async.ComponentDescriptorLookupById,
version_lookup: cnudie.retrieve_async.VersionLookupByComponent,
oci_client: oci.client_async.Client,
eol_client: eol.EolClient,
finding_cfgs: collections.abc.Sequence[odg.findings.Finding],
artefact_metadata_cfg_by_type: dict[str, compliance_summary.ArtefactMetadataCfg],
invalid_semver_ok: bool,
db_session: sqlasync.session.AsyncSession,
):
Expand All @@ -254,9 +241,7 @@ async def prefill_function_caches(
component_descriptor_lookup=component_descriptor_lookup,
version_lookup=version_lookup,
oci_client=oci_client,
eol_client=eol_client,
finding_cfgs=finding_cfgs,
artefact_metadata_cfg_by_type=artefact_metadata_cfg_by_type,
invalid_semver_ok=invalid_semver_ok,
db_session=db_session,
)
Expand Down Expand Up @@ -361,7 +346,6 @@ async def main():
)

oci_client = lookups.semver_sanitising_oci_client_async(secret_factory)
eol_client = eol.EolClient()

component_descriptor_lookup = lookups.init_component_descriptor_lookup_async(
cache_dir=parsed_arguments.cache_dir,
Expand All @@ -374,10 +358,6 @@ async def main():
default_absent_ok=True,
)

artefact_metadata_cfg_by_type = compliance_summary.artefact_metadata_cfg_by_type(
artefact_metadata_cfg=util.parse_yaml_file(paths.artefact_metadata_cfg),
)

db_session = await deliverydb.sqlalchemy_session(db_url)
try:
cache_size_bytes = await db_size(db_session=db_session)
Expand All @@ -398,9 +378,7 @@ async def main():
component_descriptor_lookup=component_descriptor_lookup,
version_lookup=version_lookup,
oci_client=oci_client,
eol_client=eol_client,
finding_cfgs=finding_cfgs,
artefact_metadata_cfg_by_type=artefact_metadata_cfg_by_type,
invalid_semver_ok=parsed_arguments.invalid_semver_ok,
db_session=db_session,
)
Expand Down
Loading
Loading