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

[Issue #2470] Removes deprecated analytics code #2718

Merged
merged 8 commits into from
Nov 5, 2024
Merged
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
43 changes: 7 additions & 36 deletions analytics/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ ROADMAP_PROJECT ?= 12
OUTPUT_DIR ?= data
CONFIG_DIR ?= config
PROJECT_CONFIG_FILE ?= $(CONFIG_DIR)/github-projects.json
SPRINT_FILE ?= $(OUTPUT_DIR)/sprint-data.json
ROADMAP_FILE ?= $(OUTPUT_DIR)/roadmap-data.json
ISSUE_FILE ?= $(OUTPUT_DIR)/issue-data.json
DELIVERY_FILE ?= $(OUTPUT_DIR)/delivery-data.json
ISSUE_FILE ?= $(OUTPUT_DIR)/delivery-data.json
SPRINT ?= @current
# Names of the points and sprint fields in the GitHub project
POINTS_FIELD ?= Points
Expand Down Expand Up @@ -146,50 +143,24 @@ lint: ## runs code quality checks
# Data Commands #
#################

sprint-data-export:
@echo "=> Exporting project data from the sprint board"
@echo "====================================================="
$(POETRY) analytics export gh_project_data \
--owner $(ORG) \
--project $(SPRINT_PROJECT) \
--output-file $(SPRINT_FILE)

gh-db-data-import:
@echo "=> Importing sprint data to the database"
@echo "====================================================="
$(POETRY) analytics import db_import --delivery-file $(DELIVERY_FILE)

roadmap-data-export:
@echo "=> Exporting project data from the product roadmap"
@echo "====================================================="
$(POETRY) analytics export gh_project_data \
--owner $(ORG) \
--project $(ROADMAP_PROJECT) \
--output-file $(ROADMAP_FILE)
$(POETRY) analytics import db_import --delivery-file $(ISSUE_FILE)

delivery-data-export:
gh-data-export:
@echo "=> Exporting GitHub issue and sprint data for delivery metrics"
@echo "====================================================="
$(POETRY) analytics export gh_delivery_data \
--config-file $(PROJECT_CONFIG_FILE) \
--output-file $(DELIVERY_FILE) \
--output-file $(ISSUE_FILE) \
--temp-dir $(OUTPUT_DIR)

issue-data-export:
@echo "=> Exporting issue data from the repository"
@echo "====================================================="
$(POETRY) analytics export gh_issue_data \
--owner $(ORG) \
--repo $(REPO) \
--output-file $(ISSUE_FILE)

gh-data-export: sprint-data-export issue-data-export roadmap-data-export delivery-data-export

sprint-burndown:
@echo "=> Running sprint burndown report for HHS/13"
@echo "====================================================="
$(POETRY) analytics calculate sprint_burndown \
--issue-file $(DELIVERY_FILE) \
--issue-file $(ISSUE_FILE) \
--output-dir $(OUTPUT_DIR) \
--sprint "$(SPRINT)" \
--project 13 \
Expand All @@ -199,7 +170,7 @@ sprint-burndown:
@echo "=> Running sprint burndown report for HHS/17"
@echo "====================================================="
$(POETRY) analytics calculate sprint_burndown \
--issue-file $(DELIVERY_FILE) \
--issue-file $(ISSUE_FILE) \
--output-dir $(OUTPUT_DIR) \
--sprint "$(SPRINT)" \
--project 17 \
Expand All @@ -210,7 +181,7 @@ percent-complete:
@echo "=> Running percent complete deliverable"
@echo "====================================================="
$(POETRY) analytics calculate deliverable_percent_complete \
--issue-file $(DELIVERY_FILE) \
--issue-file $(ISSUE_FILE) \
--output-dir $(OUTPUT_DIR) \
--include-status "In Progress" \
--include-status "Planning" \
Expand Down
30 changes: 3 additions & 27 deletions analytics/src/analytics/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from analytics.datasets.issues import GitHubIssues
from analytics.etl.github import GitHubProjectConfig, GitHubProjectETL
from analytics.etl.utils import load_config
from analytics.integrations import db, github, slack
from analytics.integrations import db, slack
from analytics.metrics.base import BaseMetric, Unit
from analytics.metrics.burndown import SprintBurndown
from analytics.metrics.burnup import SprintBurnup
Expand All @@ -24,18 +24,14 @@
# fmt: off
# Instantiate typer options with help text for the commands below
CONFIG_FILE_ARG = typer.Option(help="Path to JSON file with configurations for this entrypoint")
SPRINT_FILE_ARG = typer.Option(help="Path to file with exported sprint data")
ISSUE_FILE_ARG = typer.Option(help="Path to file with exported issue data")
ROADMAP_FILE_ARG = typer.Option(help="Path to file with exported roadmap data")
OUTPUT_FILE_ARG = typer.Option(help="Path to file where exported data will be saved")
OUTPUT_DIR_ARG = typer.Option(help="Path to directory where output files will be saved")
TMP_DIR_ARG = typer.Option(help="Path to directory where intermediate files will be saved")
OWNER_ARG = typer.Option(help="GitHub handle of the repo or project owner")
REPO_ARG = typer.Option(help="Name of the GitHub repo")
PROJECT_ARG = typer.Option(help="Number of the GitHub project")
FIELD_ARG = typer.Option(help="Name of the GitHub project field")
SPRINT_ARG = typer.Option(help="Name of the sprint for which we're calculating burndown")
UNIT_ARG = typer.Option(help="Whether to calculate completion by 'points' or 'tickets'")
OWNER_ARG = typer.Option(help="Name of the GitHub project owner, e.g. HHS")
PROJECT_ARG = typer.Option(help="Number of the GitHub project, e.g. 13")
SHOW_RESULTS_ARG = typer.Option(help="Display a chart of the results in a browser")
POST_RESULTS_ARG = typer.Option(help="Post the results to slack")
STATUS_ARG = typer.Option(
Expand Down Expand Up @@ -65,26 +61,6 @@ def callback() -> None:
# ===========================================================


@export_app.command(name="gh_project_data")
def export_github_project_data(
owner: Annotated[str, OWNER_ARG],
project: Annotated[int, PROJECT_ARG],
output_file: Annotated[str, OUTPUT_FILE_ARG],
) -> None:
"""Export data about items in a GitHub project and write it to an output file."""
github.export_project_data(owner, project, output_file)


@export_app.command(name="gh_issue_data")
def export_github_issue_data(
owner: Annotated[str, OWNER_ARG],
repo: Annotated[str, REPO_ARG],
output_file: Annotated[str, OUTPUT_FILE_ARG],
) -> None:
"""Export data about issues a GitHub repo and write it to an output file."""
github.export_issue_data(owner, repo, output_file)


@export_app.command(name="gh_delivery_data")
def export_github_data(
config_file: Annotated[str, CONFIG_FILE_ARG],
Expand Down
228 changes: 0 additions & 228 deletions analytics/src/analytics/datasets/deliverable_tasks.py

This file was deleted.

Loading
Loading