Skip to content
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

fix: update Feature interface #299

Merged
merged 3 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
10 changes: 3 additions & 7 deletions rollouts/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@

from database.models import Owner, Repository

# Declare the feature variants via Django Admin
LIST_REPOS_GENERATOR_BY_OWNER_ID = Feature(
"list_repos_generator",
0.0,
)
# Declare the feature variants and parameters via Django Admin
LIST_REPOS_GENERATOR_BY_OWNER_ID = Feature("list_repos_generator")

# Eventually we want all repos to use this
# This flag will just help us with the rollout process
USE_LABEL_INDEX_IN_REPORT_PROCESSING_BY_REPO_ID = Feature(
"use_label_index_in_report_processing",
0.0,
"use_label_index_in_report_processing"
)
4 changes: 2 additions & 2 deletions services/report/raw_upload_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def process_raw_upload(
should_use_encoded_labels = (
upload
and USE_LABEL_INDEX_IN_REPORT_PROCESSING_BY_REPO_ID.check_value(
upload.report.commit.repository.repoid, default=False
repo_id=upload.report.commit.repository.repoid, default=False
)
)
# [javascript] check for both coverage.json and coverage/coverage.lcov
Expand Down Expand Up @@ -343,7 +343,7 @@ def _adjust_sessions(
if (
upload
and USE_LABEL_INDEX_IN_REPORT_PROCESSING_BY_REPO_ID.check_value(
upload.report.commit.repository.repoid, default=False
repo_id=upload.report.commit.repository.repoid, default=False
)
and to_partially_overwrite_flags
):
Expand Down
8 changes: 6 additions & 2 deletions tasks/sync_repos.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,9 @@ def process_repos(repos):
db_session, git, owner, repository_service_ids
)
repoids = repoids_added
elif LIST_REPOS_GENERATOR_BY_OWNER_ID.check_value(ownerid, default=False):
elif LIST_REPOS_GENERATOR_BY_OWNER_ID.check_value(
owner_id=ownerid, default=False
):
with metrics.timer(
f"{metrics_scope}.sync_repos_using_integration.list_repos_generator"
):
Expand Down Expand Up @@ -340,7 +342,9 @@ def process_repos(repos):
db_session.commit()

try:
if LIST_REPOS_GENERATOR_BY_OWNER_ID.check_value(ownerid, default=False):
if LIST_REPOS_GENERATOR_BY_OWNER_ID.check_value(
owner_id=ownerid, default=False
):
with metrics.timer(f"{metrics_scope}.sync_repos.list_repos_generator"):
async for page in git.list_repos_generator():
process_repos(page)
Expand Down
Loading