Skip to content

Commit

Permalink
CODEOWNERS CI validation + pattern fixes (#2474)
Browse files Browse the repository at this point in the history
* Another try at fixing layout file ownership + CI

It seems the previous layout pattern wasn't actually matching to @rt4914. I'm hoping the adjustment fixes the issue.

Also, I'm going to try removing my global ownership & instead rely on a CI check to verify that new files that aren't owned are properly checked (https://github.com/mszostok/codeowners-validator).

* Create static_checks.yml

Create new workflow for static analysis checks (eventually we can move our linter checks to these to keep our tests in separate, dedicated workflows).

* Update static_checks.yml

Check out the repository before testing CODEOWNERS.

* Update main.yml

Temporarily disable other CI actions to avoid noise while the static checks workflow is debugged.

* Update CODEOWNERS

Remove extra & incorrect 'res' from resource file path.

* Update CODEOWNERS

Add files missing corresponding code owners, and try to blanket cover resources from all modules.

* Update CODEOWNERS

Use more specific resource file patterns since Git/GitHub doesn't like the more generic version.

* Update CODEOWNERS

Remove redundant lines (since presumably they aren't actually having the desired effect).

* Update CODEOWNERS

Fix incorrect patterns (thanks to CI check!).

* Update CODEOWNERS

Try adding invalid syntax to trigger a specific CI validation failure.

* Update CODEOWNERS

Remove intentional syntax error.

* Create random_file

Add random file to verify that CI checks catch this file doesn't have corresponding owners.

* Delete random_file

Test completed.

* Update main.yml

Re-enable main workflows now that the static checks workflow is finalized.

* Update CODEOWNERS

Move PNG file codeowners to me since they count as binary files and we want to avoid checking those into the root repository as much as possible.
  • Loading branch information
BenHenning authored Jan 14, 2021
1 parent bfafcba commit d2e6c86
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 25 deletions.
46 changes: 21 additions & 25 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,13 @@
# Blanket ownership #
#####################################################################################

# Global ownership (only for cases when new files are added & no other matches occur).
* @BenHenning

# Codeowners ownership (for adding/changing/removing code owners).
.github/CODEOWNERS @oppia/owners

# Bazel build files.
/WORKSPACE @BenHenning
WORKSPACE @BenHenning
*.bzl @BenHenning
*.bazel @BenHenning
BUILD @BenHenning
.bazelrc @BenHenning
/tools/android/ @BenHenning

Expand All @@ -56,24 +52,34 @@ gradlew.bat @BenHenning
*Test.kt @anandwana001

# All resource files.
**/res/*.xml @rt4914
/app/src/main/res/**/*.xml @rt4914
/utility/src/main/res/**/*.xml @rt4914

# Proguard configurations.
# Proguard configuration.
*.pro @BenHenning

# Lesson assets.
/domain/src/main/assets/ @BenHenning @rt4914

# Android manifests.
# Android manifests and top-level app configuration.
*Manifest.xml @BenHenning

# Linter configurations.
# Linter configuration.
buf.yaml @anandwana001

# IDEA IDE configuration.
.editorconfig @BenHenning
/.idea/ @BenHenning

# Robolectric configuration.
*.properties @BenHenning

# Firebase configuration.
/app/google-services.json @BenHenning

# Binary files.
*.png @BenHenning

# Important codebase files.
LICENSE @BenHenning

Expand All @@ -89,7 +95,7 @@ LICENSE @BenHenning
/app/src/*/java/org/oppia/android/app/player/ @BenHenning

# Bindable adapter utilities.
/app/src/main/java/org/oppia/android/app/recyclerview/BindableAdapter.java @BenHenning
/app/src/main/java/org/oppia/android/app/recyclerview/BindableAdapter.kt @BenHenning
/app/src/main/java/org/oppia/android/app/recyclerview/RecyclerViewBindingAdapter.java @BenHenning
/app/src/sharedTest/java/org/oppia/android/app/recyclerview/BindableAdapterTest.kt @BenHenning

Expand Down Expand Up @@ -126,7 +132,6 @@ LICENSE @BenHenning

# Global domain module code ownership.
/domain/**/*.kt @BenHenning
/domain/**/*.java @BenHenning

# Questions support.
/domain/src/*/java/org/oppia/android/domain/question/ @vinitamurthi
Expand All @@ -138,29 +143,23 @@ LICENSE @BenHenning
# testing module #
#####################################################################################

# Global testing module code ownership (secondary).
/testing/**/*.kt @anandwana001
/testing/**/*.java @anandwana001

# Global testing module code ownership (primary).
/testing/**/*.kt @BenHenning
/testing/**/*.java @BenHenning
# Global testing module code ownership.
/testing/**/*.kt @anandwana001 @BenHenning

#####################################################################################
# data module #
#####################################################################################

# Global data module code ownership.
/data/**/*.kt @BenHenning
/data/**/*.java @BenHenning
/data/src/test/**/*.json @BenHenning

#####################################################################################
# utility module #
#####################################################################################

# Global utility module code ownership.
/utility/**/*.kt @BenHenning
/utility/**/*.java @BenHenning

# Accessibility utilities.
/utility/src/*/java/org/oppia/android/util/accessibility/ @rt4914
Expand All @@ -185,8 +184,5 @@ LICENSE @BenHenning
# Global proto file ownership (for protos outside the model directory since all protos should belong in models).
*.proto @BenHenning @vinitamurthi

# Global model ownership (secondary).
/model/ @vinitamurthi

# Global model ownership (primary).
/model/ @BenHenning
# Global model ownership.
/model/ @vinitamurthi @BenHenning
22 changes: 22 additions & 0 deletions .github/workflows/static_checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Contains jobs corresponding to static checks (such as syntax correctness & prohibited patterns).

name: Static Checks

on:
workflow_dispatch:
pull_request:
push:
branches:
- develop

jobs:
check_codeowners:
name: Check CODEOWNERS & Repository files
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2

- uses: mszostok/[email protected]
with:
checks: "duppatterns,files,syntax"
experimental_checks: "notowned"

0 comments on commit d2e6c86

Please sign in to comment.