Skip to content

Conversation

@YustinaKvr
Copy link
Contributor

  1. Switch to new otc-metadata-rework structure

tischrei
tischrei previously approved these changes Jul 14, 2025

main(BASE_DIR_REGULAR, BASE_RTC_TABLE, BASE_DOC_TABLE, STYRING_URL_REGULAR)
main(BASE_DIR_SWISS, f"{BASE_RTC_TABLE}_swiss", f"{BASE_DOC_TABLE}_swiss", STYRING_URL_SWISS)
main(BASE_DIR_UNIFIED, BASE_RTC_TABLE, BASE_DOC_TABLE, STYRING_URL_REGULAR, target_cloud="eu_de")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of hardcoding can you dynamically query it from otc-metadata to avoid that in future you need to change it with every new env?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see need to use var here, because in case of changes, we anyway need to change it, here or in var. But using vars could potentially complicate and confuse either changes or debugging, because implies and rely on using one more tool here. So since this is not a sensitive content and not not changes very often, I'd prefer use explicit path here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, if you change target_cloud=TARGET_CLOUD, you can loop TARGET_CLOUD from fetched values from otc-metadata-rework fetch, in such way you always dynamically refer to values which are defined in otc-metadata

@YustinaKvr YustinaKvr requested a review from vladimirhasko July 14, 2025 16:16

from config import Database, EnvVariables, Timer, setup_logging

BASE_URL = "https://gitea.eco.tsi-dev.otc-service.com/api/v1"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use this as ENV variable and it should be provided by the configuration file in config map.
Don't hardcode urls here


main(BASE_DIR_REGULAR, BASE_RTC_TABLE, BASE_DOC_TABLE, STYRING_URL_REGULAR)
main(BASE_DIR_SWISS, f"{BASE_RTC_TABLE}_swiss", f"{BASE_DOC_TABLE}_swiss", STYRING_URL_SWISS)
main(BASE_DIR_UNIFIED, BASE_RTC_TABLE, BASE_DOC_TABLE, STYRING_URL_REGULAR, target_cloud="eu_de")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, if you change target_cloud=TARGET_CLOUD, you can loop TARGET_CLOUD from fetched values from otc-metadata-rework fetch, in such way you always dynamically refer to values which are defined in otc-metadata

import psycopg2
import requests

GITEA_API_ENDPOINT = "https://gitea.eco.tsi-dev.otc-service.com/api/v1"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be read from env variable, not hardcoded here

max_pages = 50
page = 1

if rtc_table == "repo_title_category":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this condition doesn't seem to me logical, we should discuss

"Other", "service_type": "cdn", "squad": "Other", "environment": "hidden"},
{"service_uri": "data-admin-service", "service_title": "Data Admin Service", "service_category": "Other",
"service_type": "das", "squad": "Other", "environment": "hidden"}
"Other", "service_type": "cdn", "squad": "Other", "target_visibility": "hidden"}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

repositories which are archived, should be skipped automatically

else:
rtctable = f"{base_rtctable}_{env_name}" if env_name != "eu_de" else base_rtctable
doctable = f"{base_doctable}_{env_name}" if env_name != "eu_de" else base_doctable
styring_url = (f"{BASE_GITEA_URL}/repos/infra/gitstyring/contents/data/github/orgs/opentelekomcloud-docs/da"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again, headers should be used?

logging.info(f"Found environments: {list(env_data.keys())}")

for env_name, services_list in env_data.items():
if env_name == "swiss":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's discuss this hardcoding

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants