-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
QA-Engine: Persist daily reports to GCS #22662
Changes from 2 commits
8e659c5
5a0170f
b7b8840
84b6686
316bbcc
ddccd0b
6049e1e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,10 @@ name: Run QA Engine | |
|
||
on: | ||
workflow_dispatch: | ||
# schedule: | ||
## 1pm UTC is 6am PDT. | ||
## same time as Generate Build Report | ||
# - cron: "0 13 * * *" | ||
schedule: | ||
# 1pm UTC is 6am PDT. | ||
# same time as Generate Build Report | ||
- cron: "0 13 * * *" | ||
|
||
jobs: | ||
run-qa-engine: | ||
|
@@ -32,3 +32,4 @@ jobs: | |
QA_ENGINE_AIRBYTE_DATA_PROD_SA: "${{ secrets.QA_ENGINE_AIRBYTE_DATA_PROD_SA }}" | ||
GITHUB_API_TOKEN: ${{ secrets.GH_PAT_MAINTENANCE_OCTAVIA }} | ||
run: run-qa-engine | ||
# run: run-qa-engine --create-prs | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: could use a TODO or a NOTE on when to uncomment and who owns it |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,15 +4,19 @@ | |
|
||
import logging | ||
|
||
from . import cloud_availability_updater, enrichments, inputs, validations | ||
from .constants import CLOUD_CATALOG_URL, OSS_CATALOG_URL | ||
import click | ||
|
||
from . import cloud_availability_updater, enrichments, inputs, outputs, validations | ||
from .constants import CLOUD_CATALOG_URL, GCS_QA_REPORT_PATH, OSS_CATALOG_URL | ||
|
||
logging.basicConfig(level=logging.INFO) | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
def main(): | ||
@click.command() | ||
@click.option("--create-prs", is_flag=True) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Very nice |
||
def main(create_prs): | ||
logger.info("Fetch the OSS connectors catalog.") | ||
oss_catalog = inputs.fetch_remote_catalog(OSS_CATALOG_URL) | ||
logger.info("Fetch the Cloud connectors catalog.") | ||
|
@@ -23,7 +27,10 @@ def main(): | |
enriched_catalog = enrichments.get_enriched_catalog(oss_catalog, cloud_catalog, adoption_metrics_per_connector_version) | ||
logger.info("Start the QA report generation.") | ||
qa_report = validations.get_qa_report(enriched_catalog, len(oss_catalog)) | ||
logger.info("Start the QA report generation.") | ||
eligible_connectors = validations.get_connectors_eligible_for_cloud(qa_report) | ||
logger.info("Start eligible connectors deployment to Cloud.") | ||
cloud_availability_updater.deploy_eligible_connectors_to_cloud_repo(eligible_connectors) | ||
logger.info("Persist QA report to GCS") | ||
outputs.persist_qa_report(qa_report, GCS_QA_REPORT_PATH, public_fields_only=False) | ||
|
||
if create_prs: | ||
logger.info("Start eligible connectors deployment to Cloud.") | ||
eligible_connectors = validations.get_connectors_eligible_for_cloud(qa_report) | ||
cloud_availability_updater.deploy_eligible_connectors_to_cloud_repo(eligible_connectors) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,13 +3,18 @@ | |
# | ||
|
||
|
||
from datetime import datetime | ||
|
||
import pandas as pd | ||
|
||
from .models import ConnectorQAReport | ||
|
||
def persist_qa_report(qa_report: pd.DataFrame, path: str, public_fields_only: bool =True): | ||
|
||
def persist_qa_report(qa_report: pd.DataFrame, path: str, public_fields_only: bool = True) -> str: | ||
report_generation_date = datetime.strftime(qa_report["report_generation_datetime"].max(), "%Y%m%d") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No its the same value on each row for a report. |
||
path = path + f"{report_generation_date}_qa_report.jsonl" | ||
final_fields = [ | ||
field.name for field in ConnectorQAReport.__fields__.values() | ||
if field.field_info.extra["is_public"] or not public_fields_only | ||
field.name for field in ConnectorQAReport.__fields__.values() if field.field_info.extra["is_public"] or not public_fields_only | ||
] | ||
qa_report[final_fields].to_json(path, orient="records") | ||
qa_report[final_fields].to_json(path, orient="records", lines=True) | ||
return path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 turn it on!