Skip to content

Commit

Permalink
ci: enable yamllint [INFENG-116] (#5359)
Browse files Browse the repository at this point in the history
* Add yamllint check to precommit
* Reformat .github yaml files
  • Loading branch information
dannysauer authored Nov 3, 2022
1 parent 282ddc0 commit 892ef4a
Show file tree
Hide file tree
Showing 20 changed files with 75 additions and 36 deletions.
19 changes: 13 additions & 6 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: 🐛 Bug Report
title: '🐛[bug] '
description: Report a bug
Expand All @@ -6,16 +7,20 @@ labels: ['bug']
body:
- type: markdown
attributes:
value: |
value: >
## Before you file an issue...
1. Please search for [existing issues](https://github.com/determined-ai/determined/issues) if there are any relavant issues
1. Please search for
[existing issues](https://github.com/determined-ai/determined/issues)
if there are any relavant issues
- type: textarea
id: description
attributes:
label: Describe the bug
description: |
A clear description of what the bug is. Please attach screenshot into Screenshot section below.
description: >
A clear description of what the bug is. Please attach screenshot into
Screenshot section below.
placeholder: Bug description
validations:
required: true
Expand All @@ -40,7 +45,8 @@ body:
id: expectation
attributes:
label: Expected Behavior
description: A clear and concise description of what you expected to happen
description: >
A clear and concise description of what you expected to happen
placeholder: It should work like ...
validations:
required: true
Expand All @@ -49,7 +55,8 @@ body:
id: screenshot
attributes:
label: Screenshot
description: If applicable, add screenshots to help explain your problem.
description: >
If applicable, add screenshots to help explain your problem.
placeholder: It should work like ...
validations:
required: true
Expand Down
4 changes: 3 additions & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
contact_links:
- name: 💬 Slack
url: https://determined-community.slack.com/join/shared_invite/zt-cnj7802v-KcVbaUrIzQOwmkmY7gP0Ew#/shared-invite
about: Ask questions and talk to other Determined.ai users and the maintainers
about: >
Ask questions and talk to other Determined.ai users and the maintainers
13 changes: 9 additions & 4 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: 💡 Feature Request
title: '💡[feat] '
description: Request a new feature
Expand All @@ -8,8 +9,9 @@ body:
id: description
attributes:
label: Describe the problem
description: |
Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is.
description: >
Is your feature request related to a problem? Please describe. A
clear and concise description of what the problem is.
placeholder: Ex. I'm always frustrated when [...]
validations:
required: true
Expand All @@ -26,14 +28,17 @@ body:
id: alternative
attributes:
label: Describe alternatives you've considered
description: A clear and concise description of any alternative solutions or features you've considered.
description: >
A clear and concise description of any alternative solutions or
features you've considered.
validations:
required: false

- type: textarea
id: additional_context
attributes:
label: Additional context
description: Add any other context or screenshots about the feature request here.
description: >
Add any other context or screenshots about the feature request here.
validations:
required: false
7 changes: 5 additions & 2 deletions .github/ISSUE_TEMPLATE/question.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: 🤔 Question
title: '🤔[question] '
description: Question
Expand All @@ -8,9 +9,11 @@ body:
id: description
attributes:
label: Describe your question
description: |
description: >
We have Slack community too.
Feel free to join the community from [here](https://determined-community.slack.com/join/shared_invite/zt-cnj7802v-KcVbaUrIzQOwmkmY7gP0Ew#/shared-invite)
Feel free to join the community from
[here](https://determined-community.slack.com/join/shared_invite/zt-cnj7802v-KcVbaUrIzQOwmkmY7gP0Ew#/shared-invite)
placeholder: Ex. I have a question about...
validations:
required: true
2 changes: 2 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ updates:
interval: daily
# reviewers:
# - determined-ai/someteam
open-pull-requests-limit: 10

# Maintain dependencies for agent Docker
- package-ecosystem: docker
Expand All @@ -26,6 +27,7 @@ updates:
interval: daily
# reviewers:
# - determined-ai/someteam
open-pull-requests-limit: 10

# Maintain dependencies for leader Golang
- package-ecosystem: gomod
Expand Down
3 changes: 2 additions & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
shared-web:
- webui/react/src/shared/**
- webui/react/src/shared/**
11 changes: 6 additions & 5 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
name: "Pull Request Labeler"

on:
- pull_request_target
on: # yamllint disable-line rule:truthy
- pull_request_target

jobs:
triage:
Expand All @@ -10,6 +11,6 @@ jobs:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4
with:
repo-token: ${{ secrets.DETERMINED_TOKEN }}
- uses: actions/labeler@v4
with:
repo-token: ${{ secrets.DETERMINED_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/link-artifacts.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: "Link artifacts"

on:
on: # yamllint disable-line rule:truthy
status

jobs:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint-bindings.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: "Lint bindings"

on:
on: # yamllint disable-line rule:truthy
pull_request:
paths-ignore:
- '*.md'
Expand All @@ -15,7 +15,7 @@ jobs:
build-proto:
runs-on: ubuntu-latest
env:
GO111MODULE: on
GO111MODULE: "on"
steps:
- uses: actions/checkout@v3
- name: Setup Go
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-docs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: "Lint docs"

on:
on: # yamllint disable-line rule:truthy
pull_request:
paths:
- 'docs/*'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint-go.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: "Lint go"

on:
on: # yamllint disable-line rule:truthy
pull_request:
paths-ignore:
- '*.md'
Expand All @@ -20,7 +20,7 @@ jobs:
service: [agent, master, proto]
runs-on: ubuntu-latest
env:
GO111MODULE: on
GO111MODULE: "on"
steps:
- uses: actions/checkout@v3
- name: Setup Go
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/lint-migrations.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
name: "Lint migrations"

on:
on: # yamllint disable-line rule:truthy
pull_request:
paths:
- master/static/migrations/**
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-python.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: "Lint python"

on:
on: # yamllint disable-line rule:truthy
pull_request:
paths-ignore:
- '*.md'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-react.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: "Lint react"

on:
on: # yamllint disable-line rule:truthy
pull_request:
paths:
- 'webui/*'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-secrets.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: "Lint secrets"

on:
on: # yamllint disable-line rule:truthy
push:
branches:
- 'main'
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/scan-docker-images.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: "Scan Docker images"

on:
on: # yamllint disable-line rule:truthy
schedule:
- cron: "15 1 * * 0"

Expand All @@ -16,7 +16,10 @@ jobs:
id: get-images
uses: mikefarah/yq@master
with:
cmd: yq -o=json '[with_entries(select(.key | test("_hashed$"))).[].new]' tools/scripts/bumpenvs.yaml
cmd: |
yq -o=json \
'[with_entries(select(.key | test("_hashed$"))).[].new]' \
tools/scripts/bumpenvs.yaml
scan-images:
needs: list-images
runs-on: ubuntu-latest
Expand Down Expand Up @@ -48,4 +51,4 @@ jobs:
sarif_file: ${{ steps.scan.outputs.sarif }}
- name: Fail job if scan failed
if: steps.scan.outcome == 'failure'
run: exit 1
run: exit 1
3 changes: 2 additions & 1 deletion .github/workflows/semantic.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
name: "Semantic Pull Request v2"

on:
on: # yamllint disable-line rule:truthy
pull_request_target:
types:
- opened
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test-cli.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: "Test det CLI"

on:
on: # yamllint disable-line rule:truthy
pull_request:
paths-ignore:
- '*.md'
Expand Down Expand Up @@ -35,13 +35,13 @@ jobs:
python -m pip install --upgrade pip
pip --version
# Windows needs special treatment of cryptography for unknown reasons.
# LMDB also has special requirements that only apply to windows (patch-ng).
# LMDB also has special reqs that only apply to windows (patch-ng).
pip install wheel cryptography patch-ng
cd harness; python setup.py bdist_wheel -d ../build
- name: Install determined
run: |
pip install --find-links build determined==${{ env.VERSION }}
# Ensure Determined cli can run without installing cli test requirements
# Ensure Determined cli can run without installing cli test reqs
det --help
pip freeze --all
# Allow this to fail, but it is useful for debugging.
Expand Down
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,8 @@ repos:
language: system
files: '^webui/react/'
types_or: [markdown, json]
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.17.0
hooks:
- id: yamllint
files: '^.github/'
8 changes: 8 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
extends: default
rules:
line-length:
level: warning
allow-non-breakable-words: true
allow-non-breakable-inline-mappings: true
max: 100

0 comments on commit 892ef4a

Please sign in to comment.