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

Refactor TAG ENV PR QA workflow #269

Merged
merged 23 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
1fbe50f
chore: refactor QA GitHub Worfklow
guidemetothemoon Nov 10, 2023
d351ce9
chore: update package.json and remove husky
guidemetothemoon Nov 11, 2023
170c4ee
chore: update makdownlint.json config name
guidemetothemoon Nov 11, 2023
880d5b1
chore: update QA configs path
guidemetothemoon Nov 11, 2023
1454eae
chore: add checkout step to second job
guidemetothemoon Nov 11, 2023
0153566
chore: update QA steps, fix dead links
guidemetothemoon Nov 11, 2023
b80e1bc
chore: update cSpell config
guidemetothemoon Nov 11, 2023
d780e55
chore: improve cSpell config
guidemetothemoon Nov 11, 2023
e2d7899
chore: improve cSpell config
guidemetothemoon Nov 11, 2023
2a21f21
chore: improve cSpell config
guidemetothemoon Nov 11, 2023
3e52dc5
chore: improve cSpell config
guidemetothemoon Nov 11, 2023
dbf531a
chore: improve cSpell config
guidemetothemoon Nov 11, 2023
4be74d4
chore: improve cSpell config
guidemetothemoon Nov 11, 2023
bc7db47
chore: improve link-check config
guidemetothemoon Nov 11, 2023
cc67426
chore: improve link-check config
guidemetothemoon Nov 11, 2023
e90ade0
chore: improve link-check config
guidemetothemoon Nov 11, 2023
c50fb90
chore: improve link-check config
guidemetothemoon Nov 11, 2023
4f53d08
chore: improve link-check config
guidemetothemoon Nov 11, 2023
bbd36eb
chore: improve link-check config
guidemetothemoon Nov 11, 2023
d3b0a59
chore: improve link-check config
guidemetothemoon Nov 11, 2023
6dbf81c
chore: improve link-check config
guidemetothemoon Nov 11, 2023
753e908
chore: fix link-check config regexes
guidemetothemoon Nov 12, 2023
2effc46
chore: add local QA script, docs
guidemetothemoon Nov 12, 2023
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
61 changes: 36 additions & 25 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,46 @@
---
name: Check
name: Quality Checks

on:
pull_request:

jobs:
Setup:
run-quality-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup
run: make setup
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: tj-actions/changed-files@v39
id: changed-files
with:
files: '**/*.md'
separator: ','

Markdown:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: npm run check:markdown
- name: Lint Markdown files
uses: DavidAnson/markdownlint-cli2-action@v13.0.0
if: steps.changed-files.outputs.any_changed == 'true'
with:
globs: ${{ steps.changed-files.outputs.all_changed_files }}
separator: ','
config: '.markdownlint.json'
fix: true
continue-on-error: false

Spelling:
runs-on: ubuntu-latest
needs: Setup
steps:
- uses: actions/checkout@v3
- name: Spelling
run: make spelling

Links:
runs-on: ubuntu-latest
needs: Setup
steps:
- uses: actions/checkout@v3
- name: Links
run: make links
- name: Validate spelling
uses: streetsidesoftware/cspell-action@v4.0.1
with:
config: 'cspell.json'
files: '**/*.md'
inline: 'error'
strict: true
incremental_files_only: true

- name: Validate links in Markdown files
uses: gaurav-nelson/github-action-markdown-link-check@1.0.15
with:
check-modified-files-only: 'yes'
config-file: 'link-config.json'
base-branch: 'main'
file-extension: '.md'
32 changes: 0 additions & 32 deletions Makefile

This file was deleted.

6 changes: 0 additions & 6 deletions checks/links.sh

This file was deleted.

6 changes: 0 additions & 6 deletions checks/setup.sh

This file was deleted.

5 changes: 0 additions & 5 deletions checks/spelling.sh

This file was deleted.

36 changes: 36 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
{
"version": "0.2",
"language": "en",
"caseSensitive": false,
"dictionaries": ["en_US", "en-gb", "companies", "softwareTerms", "misc", "filetypes", "tag", "html"],
"ignorePaths": [],
"dictionaryDefinitions": [
{ "name": "tag", "path": "./tag-custom-dictionary-cspell.txt"}
],
"words": [
"CNCF",
"K8s",
Expand All @@ -28,5 +33,36 @@
"cloudcustodian",
"coefficiency",
"SIEC"
],
"ignoreWords": [],
"ignoreRegExpList": [
"code",
"links"
],
"patterns": [
{
"name": "code-block-multi-line",
"pattern": "/^```(.*)\n([\\s\\S]*?)```$/g"
},
{
"name": "code-block-single-line",
"pattern": "/```(.*)([\\s\\S]*?)```/g"
},
{
"name": "code",
"pattern": ["code-block-single-line", "code-block-multi-line"]
},
{
"name": "markdown-links",
"pattern": "/!?\\[([^\\]]*)\\]\\(([^\\)]+)\\)/g"
},
{
"name": "html-links",
"pattern": "/<a\\s+(?:[^>]*?\\s+)?href=\"[^\"]*\".*<\/a>/g"
},
{
"name": "links",
"pattern": ["markdown-links", "html-links"]
}
]
}
23 changes: 0 additions & 23 deletions docker-compose.yml

This file was deleted.

4 changes: 2 additions & 2 deletions governance/contributor-ladder.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ It is important to present the working group proposal during TAG meetings and be

## Nominated as Tech Lead

To serve in the role as Tech Lead, you have to go through the [tech lead proposal process](https://github.com/cncf/tag-env-sustainability/blob/main/governance/tech-lead-proposal-process.md).
To serve in the role as Tech Lead, you have to go through the [tech lead proposal process](https://github.com/cncf/tag-env-sustainability/blob/main/governance/lead-proposal-process.md#tag-leadership-election-process).
Assuming the role of a technical lead within the Environmental Sustainability TAG places greater responsibilities on your shoulders as part of the leadership team.
This roles provides you with the opportunity to actively support the leadership team by taking charge of a specific topic within the TAG.
As an elected Tech Lead and a member of the leadership team, you will have the chance to delve into the broader aspects of leading the community group, gaining insights into the organizational structures within the CNCF.
Expand All @@ -100,7 +100,7 @@ Your position as a technical lead allows you to contribute significantly to the

## Nominated as Co-Chair

To serve in the role of Co-Chair, you have to go through the [chair proposal process](https://github.com/cncf/tag-env-sustainability/blob/main/governance/chair-proposal-process.md).
To serve in the role of Co-Chair, you have to go through the [chair proposal process](lead-proposal-process.md).
With your appointment as Co-Chair of TAG for Environmental Sustainability, you assume a key leadership position within the Group.
Your will steer and evolve the community to achieve its goals and targets.
You coordinate between the TAG and the CNCF Technical Oversight Committee (TOC) and the overall CNCF ecosystem, ensuring effective communication and alignment of efforts.
Expand Down
4 changes: 2 additions & 2 deletions governance/roles.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ The general list of activities for TL are:
* Resolve cross-sub-project technical issues and decisions
* Propose agenda items for meetings to ensure that open issues are discussed with the group when needed

[Environmental Sustainability TAG TL nomination process](tech-lead-proposal-process.md)
[Environmental Sustainability TAG TL nomination process](lead-proposal-process.md)

## Working Group Leads

Expand Down Expand Up @@ -117,7 +117,7 @@ Examples are:

## Project Lead

A project can be formed if corss contributor collaboration is needed.
A project can be formed if cross-contributor collaboration is needed.
The process document gives information how to form a [project](process.md).

Depending on the expected length of the project, Project Leads may be assigned as OWNERS of the project directory in this repository to help facilitate and moderate new content to the project.
Expand Down
10 changes: 9 additions & 1 deletion checks/link-config.json → link-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,18 @@
"fallbackRetryDelay": "5s",
"ignorePatterns": [
{
"pattern": "^https://twitter"
"pattern": "^(http|https):\/\/(www\\.)?(linkedin|twitter)"
}
],
"replacementPatterns": [
{
"pattern": "^/images/",
"replacement": "/website/static/images/"
},
{
"pattern": "^/landscape(.+)?/",
"replacement": "/website/content/landscape/"
},
{
"pattern": "^/",
"replacement": "{{BASEURL}}/"
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@
"cd:site": "npm run _cd:site -- npm run",
"check:links:internal": "npm run cd:site check:links:internal",
"check:links": "npm run cd:site check:links",
"check:markdown": "npx markdownlint '*.md' '*/*.md' website/content",
"check:markdown": "npx markdownlint-cli2 '*.md' '*/*.md' website/content",
"fix:markdown": "npm run check:markdown -- --fix",
"get:submodule": "set -x && git submodule update --init ${DEPTH:- --depth 1}",
"precheck:markdown": "npm list markdownlint-cli || npm install markdownlint-cli",
"precheck:markdown": "npm list markdownlint-cli2 || npm install markdownlint-cli2",
"prepare": "npm run site-install",
"qa:dev": "./qa-checks-local.sh",
"serve:dev": "npm run cd:site serve:dev",
"serve": "npm run cd:site serve",
"site-install": "npm run _cd:site -- npm install",
"test": "npm run cd:site test"
},
"devDependencies": {
"cspell": "^6.31.3",
"cspell": "^8.0.0",
"htmltest-bin": "github:chalin/htmltest-bin#semver:0.17.0",
"markdown-link-check": "^3.11.2",
"markdownlint-cli": "^0.35.0",
"markdownlint-cli2": "^0.10.0",
"prettier": "^3.0.1"
},
"enginesComment": "Ensure that engines.node value stays consistent with the project's .nvmrc",
Expand Down
4 changes: 2 additions & 2 deletions projects/glossary/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ This causes the inside of a greenhouse to get hotter and hotter, the same as wha
#### **Net Zero**

Stands for zero-carbon emission. This means that a company that causes carbon emissions needs to store or neutralize the same amount of carbon.
In the best case scenario, an organization doesnt cause carbon pollution at all.
In the best case scenario, an organization doesn't cause carbon pollution at all.

### O

Expand Down Expand Up @@ -105,4 +105,4 @@ SIEC - Server Idle Energy Coefficiency
## Additional Resources

* [1] Glossary of Climate Change - <https://www.wikiwand.com/en/Glossary_of_climate_change>
* [2] Climate Change Vocabulary - <https://www.health.state.mn.us/communities/environment/climate/docs/film/vocab_list.pdf>
* [2] Climate Change Vocabulary - <https://winapps.umt.edu/winapps/media2/wilderness/toolboxes/documents/climate/Climate%20Change%20Glossary.pdf>
29 changes: 29 additions & 0 deletions qa-checks-local.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env bash
echo -e "\033[1;35m Checking presence of QA tools...If not present, a tool will be installed.\033[0m\n"

npm list markdownlint-cli2 || npm install -g markdownlint-cli2
npm list markdown-link-check || npm install -g markdown-link-check
npm list cspell || npm install -g cspell

echo -e "\033[1;35m Checking modified files...\033[0m\n"
files=$(git diff --name-only --diff-filter=AM main $HEAD | grep '\.md$')

echo -e "\033[1;35m ######## LINTING ########\033[0m\n"
echo -e "\033[1;35m Running Markdown linting on modified files...\033[0m\n"
for file in $files; do
npx markdownlint-cli2 --fix --config ./.markdownlint.json "$file"
done

echo -e "\n\033[1;35m ######## SPELLING ########\033[0m\n"
echo -e "\033[1;35m Running spelling validation on modified files...\033[0m\n"
for file in $files; do
npx cspell --config ./cspell.json "$file"
done

echo -e "\n\033[1;35m ######## LINKS ########\033[0m\n"
echo -e "\033[1;35m Running Markdown links validation on modified files...\033[0m\n"
for file in $files; do
npx markdown-link-check --config ./link-config.json --progress --verbose "$file"
done

echo -e "\n\033[1;32m Done!\033[0m"
54 changes: 54 additions & 0 deletions tag-custom-dictionary-cspell.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
Amaral
Atanas
Atanasov
Autoscaler
Autoscalers
Bianchi
CAPI
Cahill
Cantalupo
Ciarlante
Cockroft
Costbusters
DVFS
Davide
Devochko
Enviro
Falco
GEOPM
GHGP
Huamin
Iontel
Jochen
Joswig
KEDA
Kautz
Körbächer
Leekin
Manoledaki
Marlow
Niki
OSTI
Pahlke
Parul
Perycz
Poko
Przemysław
Quarkus
Qube
RAPL
Rezaie
Rimma
SWIOTLB
Scaphandre
Sidero
TSSA
Taber
Tatsuhiro
Uncore
guidemetothemoon
hyperscale
hyperscalers
nikimanoledaki
renewables
schedulable
2 changes: 1 addition & 1 deletion website/content/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ This TAG's goal is to advocate for, develop, support, and help evaluate environm
- [LinkedIn](https://www.linkedin.com/company/cncf-tag-environmental-sustainability)
- [Twitter/X](https://twitter.com/CNCFEnvTAG)
- [Mailing list](https://lists.cncf.io/g/cncf-tag-env-sustainability/topics)
- [Surveys](https://github.com/cncf/tag-env-sustainability/tree/main/surveys)
- [Surveys](https://github.com/cncf/tag-env-sustainability/tree/main/artifacts/surveys)

## Meetings

Expand Down
Loading