Skip to content

Commit 3322c56

Browse files
authored
Merge pull request #243 from DSACMS/fix-workflow-pipeline
Fix Metrics Core Workflow Pipeline
2 parents e7c837d + d192b42 commit 3322c56

6 files changed

+173
-128
lines changed

.github/workflows/cicd.yml

+101-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ name: CICD
22

33
on:
44
schedule:
5-
# Run Mondays at 5:15 am
6-
- cron: "15 5 * * 0"
5+
# Run Mondays at 7:15 am
6+
- cron: "15 7 * * 0"
77
workflow_dispatch:
88

99
permissions:
@@ -16,10 +16,109 @@ concurrency:
1616
cancel-in-progress: false
1717

1818
jobs:
19+
update:
20+
strategy:
21+
matrix:
22+
orgs: ["DSACMS","Enterprise-CMCS","CMS-Enterprise","CMSgov"]
23+
max-parallel: 1
24+
permissions: write-all
25+
name: update
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v4
29+
# update stats
30+
- uses: actions/setup-python@v5
31+
with:
32+
python-version: '3.9'
33+
- name: cache pip
34+
uses: actions/cache@v4
35+
with:
36+
path: ~/.cache/pip
37+
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
38+
restore-keys: |
39+
${{ runner.os }}-pip-
40+
- run: pip install -r requirements.txt
41+
- run: git pull && ./update.sh ${{ matrix.orgs }}
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.METRICS_GITHUB_TOKEN }}
44+
AUGUR_HOST: ${{ vars.AUGUR_HOST }}
45+
- run: |
46+
git config user.name 'GitHub Actions'
47+
git config user.email '[email protected]'
48+
git pull
49+
git add -A
50+
timestamp=$(date -u)
51+
git commit -m "update ${{ matrix.orgs }} data: ${timestamp}" || exit 0
52+
- name: Push to ${{ github.ref_name }}
53+
uses: CasperWA/push-protected@v2
54+
with:
55+
token: ${{ secrets.METRICS_GITHUB_TOKEN }}
56+
branch: ${{ github.ref_name }}
57+
cocomo:
58+
strategy:
59+
matrix:
60+
orgs: ["DSACMS", "Enterprise-CMCS", "CMS-Enterprise", "CMSgov"]
61+
max-parallel: 1
62+
permissions: write-all
63+
name: cocomo
64+
runs-on: ubuntu-latest
65+
needs: update
66+
steps:
67+
- uses: actions/checkout@v4
68+
- uses: actions/setup-go@v5
69+
- name: Install scc
70+
run: go install github.com/boyter/scc/v3@latest
71+
- name: Run COCOMO script
72+
run: ./scripts/scc_cocomo.sh ${{ matrix.orgs }}
73+
- name: Commit changes
74+
run: |
75+
git config user.name 'GitHub Actions'
76+
git config user.email '[email protected]'
77+
git pull
78+
git add -A
79+
timestamp=$(date -u)
80+
git commit -m "update ${{ matrix.orgs }} data: ${timestamp}" || exit 0
81+
- name: Push to ${{ github.ref_name }}
82+
uses: CasperWA/push-protected@v2
83+
with:
84+
token: ${{ secrets.METRICS_GITHUB_TOKEN }}
85+
branch: ${{ github.ref_name }}
86+
scorecard:
87+
strategy:
88+
matrix:
89+
orgs: ["DSACMS", "Enterprise-CMCS", "CMS-Enterprise", "CMSgov"]
90+
max-parallel: 1
91+
permissions: write-all
92+
name: scorecard
93+
runs-on: ubuntu-latest
94+
needs: cocomo
95+
steps:
96+
- uses: actions/checkout@v4
97+
- uses: actions/setup-go@v5
98+
- name: Install OSSF CLI
99+
run: docker pull gcr.io/openssf/scorecard:stable
100+
- name: Run OSSF Scorecard Report script
101+
run: ./scripts/scorecard_internal.sh ${{ matrix.orgs }}
102+
env:
103+
GITHUB_TOKEN: ${{ secrets.METRICS_GITHUB_TOKEN }}
104+
- name: Commit changes
105+
run: |
106+
git config user.name 'GitHub Actions'
107+
git config user.email '[email protected]'
108+
git pull
109+
git add -A
110+
timestamp=$(date -u)
111+
git commit -m "update ${{ matrix.orgs }} data: ${timestamp}" || exit 0
112+
- name: Push to ${{ github.ref_name }}
113+
uses: CasperWA/push-protected@v2
114+
with:
115+
token: ${{ secrets.METRICS_GITHUB_TOKEN }}
116+
branch: ${{ github.ref_name }}
19117
update-reports-and-graphs:
20118
permissions: write-all
21119
name: update reports and graphs
22120
runs-on: ubuntu-latest
121+
needs: scorecard
23122
steps:
24123
- uses: actions/checkout@v4
25124
# update stats

.github/workflows/contributors.yml

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
on:
2-
push:
3-
branches:
4-
- main
52
workflow_dispatch:
63

74
jobs:

.github/workflows/scorecard_internal.yml

-39
This file was deleted.

.github/workflows/update_cocomo_stats.yml

-37
This file was deleted.

.github/workflows/update_data.yml

-47
This file was deleted.

docs/MetricsGlossary.md

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Terms on the Metrics Website
2+
3+
## Organization
4+
An organization is a team of collaborators and contributors, along with project repositories. An organizational account allows people to become members and collaborate on the repositories it contains. Members can assume different roles with varying responsibilities and abilities.
5+
6+
### DSACMS
7+
**Digital Services at CMS**. The digital services and initiatives managed by the Centers for Medicare & Medicaid Services (CMS) to enhance their digital platforms and services.
8+
9+
### CMS-Enterprise
10+
Repositories related to the operations of the Centers for Medicare and Medicaid Services.
11+
12+
### CMSgov
13+
Open Source repositories released by the Centers for Medicare and Medicaid Services.
14+
15+
### Enterprise-CMCS
16+
Center for Medicaid & CHIP Services.
17+
18+
## Repository
19+
Also known as “repo,” a repository is the most basic element of GitHub. It's easiest to imagine as a project's folder. A repository contains all of the project files (including documentation) and stores each file's revision history. Repositories can have multiple collaborators and can be either public or private.
20+
21+
## Metrics
22+
Measurable data points that help visualize and analyze contributions and interactions within GitHub Repositories (projects). Metrics can provide insights into the activity, health, and engagement of a repository.
23+
24+
## Issues
25+
Issues are a way to track tasks, enhancements, bugs, and discussions or feedback in a repository. Analyzing the number of open vs. closed issues helps gauge project progress and team workload.
26+
27+
## Commits
28+
Commits are individual changes made to the codebase. Each commit includes a unique ID, a message describing the change, and a timestamp. Tracking commits helps understand how frequently changes are made and how active development is.
29+
30+
## Pull Requests (PRs)
31+
Pull requests are a way to propose changes to a codebase. When a developer wants to merge their changes from a branch into another (typically the main branch), they create a PR. This facilitates code review and discussion before the changes are merged. Metrics like the number of open vs. closed PRs, average time to merge, and comments can reveal the efficiency of the review process and team collaboration.
32+
33+
## Forks
34+
Forks are copies of a repository that allow users to freely experiment with changes without affecting the original project. They are commonly used for developing features or fixes that can later be submitted back to the original repository via pull requests. A high number of forks can indicate community interest and the potential for external contributions, showcasing the project's relevance and usability.
35+
36+
## Stars
37+
Stars are a way for users to show appreciation for a repository. A star can be thought of as a "like" or "bookmark," indicating that a user finds the project interesting or useful. The number of stars can be a metric for a project's popularity or perceived value.
38+
39+
## Watchers
40+
Watchers are users who subscribe to updates for a repository. They receive notifications about discussions, issues, and commits. The number of watchers can indicate how many people are actively interested in the project's progress.
41+
42+
## Followers
43+
Watchers are users who subscribe to updates for an organization's public activity(new repositories, discussions...).
44+
45+
## Diff
46+
Diff refers to the difference in metrics such as issues, commits, or PRs between this week and last week. It highlights changes in contributions or activity over time.
47+
48+
## % Diff
49+
% Diff represents the percentage change in a given metric (like issues, commits, or PRs) compared to the previous week. It provides a quick view of growth or decline, helping teams assess their activity levels and project health over time.
50+
51+
52+
# Terms In the Metrics Repository
53+
54+
## OSPO
55+
**Open Source Program Office**. A department or team within an organization that manages and oversees open source software initiatives, including contributions, compliance, and community engagement.
56+
57+
## Feature Branch
58+
A feature branch is a separate branch in a version control system (like Git) used to develop a new feature or make changes to the project. It allows developers to work on features independently of the main codebase and merge changes back once the feature is complete.
59+
60+
## Hotfix
61+
A quick and immediate fix applied to a live production environment to address a critical issue or bug. Hotfixes are usually implemented outside the regular release cycle to minimize downtime and resolve urgent problems.
62+
63+
## PEP8
64+
**Python Enhancement Proposal 8**. A style guide for Python code that outlines conventions for writing clean and readable Python code. It includes recommendations on formatting, naming conventions, and code structure.
65+
66+
## Linting
67+
The process of running a program (a linter) that analyzes source code to identify potential errors, stylistic issues, and code quality problems. Linting helps maintain code quality and consistency across a project.
68+
69+
## Eleventy
70+
A simple and flexible static site generator. It allows developers to build static websites using various template languages and provides tools for customizing and optimizing static site builds.
71+
72+

0 commit comments

Comments
 (0)