Skip to content
Open
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
18 changes: 18 additions & 0 deletions .chloggen/remove_allowlistgen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: breaking

# The name of the component, or a single word describing the area of concern, (e.g. crosslink)
component: githubgen

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Stop generating the .github/ALLOWLIST file

# One or more tracking issues related to the change
issues: [1505]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext: |
This file has no bearing to GitHub, the CODEOWNERS file already contains a list of unmaintained components.
Further, this file is flagged incorrectly by security tools as problematic.
3 changes: 1 addition & 2 deletions githubgen/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# githubgen

This executable is used to generate `.github/CODEOWNERS` and
`.github/ALLOWLIST` files.
This executable is used to generate `.github/CODEOWNERS` files.

It reads status metadata from `metadata.yaml` files located throughout the
repository.
Expand Down
21 changes: 1 addition & 20 deletions githubgen/codeowners.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,17 @@ func (cg *codeownersGenerator) Generate(data datatype.GithubData) error {
return err
}

var ownerComponents, allowListUnmaintainedComponents, unmaintainedCodeowners, distributions, allowListDeprecatedComponents []string
var ownerComponents, unmaintainedCodeowners, distributions []string

LOOP:
for _, folder := range data.Folders {
m := data.Components[folder]
// check if component is unmaintained or deprecated
for stability := range m.Status.Stability {
if stability == unmaintainedStatus {
allowListUnmaintainedComponents = append(allowListUnmaintainedComponents, folder)
unmaintainedCodeowners = append(unmaintainedCodeowners, fmt.Sprintf("%s/%s %s", folder, strings.Repeat(" ", data.MaxLength-len(folder)), data.DefaultCodeOwner))
continue LOOP
}
if stability == deprecatedStatus && (m.Status.Codeowners == nil || len(m.Status.Codeowners.Active) == 0) {
allowListDeprecatedComponents = append(allowListDeprecatedComponents, folder+"/\n")
}
}

// check and handle active codeowners
Expand Down Expand Up @@ -95,21 +91,6 @@ LOOP:
if err != nil {
return err
}

// ALLOWLIST file
allowListFile := filepath.Join(data.RootFolder, ".github", "ALLOWLIST")
allowListContents, err := cg.getFile(allowListFile)
if err != nil {
return err
}

allowListContents = injectContent(startUnmaintainedList, endUnmaintainedList, allowListContents, allowListUnmaintainedComponents)
allowListContents = injectContent(startDeprecatedList, endDeprecatedList, allowListContents, allowListDeprecatedComponents)

err = cg.setFile(allowListFile, allowListContents)
if err != nil {
return err
}
return nil
}

Expand Down
3 changes: 0 additions & 3 deletions githubgen/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ const startComponentList = `# Start components list`
const endComponentList = `# End components list`
const startUnmaintainedList = `# Start unmaintained components list`
const endUnmaintainedList = `# End unmaintained components list`
const startDeprecatedList = `# Start deprecated components list`
const endDeprecatedList = `# End deprecated components list`
const startDistributionList = `# Start distribution list`
const endDistributionList = `# End distribution list`
const unmaintainedStatus = "unmaintained"
const deprecatedStatus = "deprecated"
1 change: 0 additions & 1 deletion githubgen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (

// Generates files specific to GitHub according to status datatype.Metadata:
// .github/CODEOWNERS
// .github/ALLOWLIST
// .github/ISSUE_TEMPLATES/*.yaml (list of components)
// reports/distributions/*
func main() {
Expand Down
Loading