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

WIP: test stale repositories #3210

Merged
merged 24 commits into from
Sep 24, 2020
Merged

Conversation

mrKappen
Copy link
Collaborator

@mrKappen mrKappen commented Aug 12, 2020

ref: #3211

@avelino
Copy link
Owner

avelino commented Aug 12, 2020

Thank you for contributing with awesome-go, we will revise your contribution as soon as possible.

Automation body links content check:

  • godoc.org or pkg.go.dev: True
  • goreportcard.com: False
  • coverage: True

your project is about to be approved, it's under revision, it may take a few days

}
buf := new(bytes.Buffer)
json.NewEncoder(buf).Encode(body)
req, err := http.NewRequest("POST", githubPOSTISSUES, buf)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the issue already exists we cannot reopen, this can generate many repeated issues (flood)
we should see if the issue already exists and is open (looking for the title pattern)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@avelino I added a check in the latest commit

"golang.org/x/oauth2"
)

var reGithubRepo = regexp.MustCompile("https://github.com/[a-zA-Z0-9-.]+/[a-zA-Z0-9-.]+$")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

has a repository that can be outside the github, example:

  • gitlab
  • bitbucket
  • ...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey @avelino. That is a good point. Should we restrict this to a set of possible sites (i.e. github, gitlab and bitbucket). I made use of the github api to check the commit age of a repository and there is an api. If we are handling all possible repository hosting sites how would we handle each specific one?

scripts.go Outdated
if err != nil {
panic(err)
}
html := append([]byte("<body>"), blackfriday.MarkdownCommon(input)...)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

html := fmt.Sprintf("<body>%s</body>", blackfriday.MarkdownCommon(input))

@avelino avelino changed the title Test stale repositories WIP: test stale repositories Aug 24, 2020
@mrKappen
Copy link
Collaborator Author

Hey @avelino, currently there are 655 repositories that could potentially be stale according to the current definition (> 1 year since last commit). I don't want to create 655 issues in one go, so I have added a limit to the number of issues that are made each time the script is run (currently set at 10)

@avelino
Copy link
Owner

avelino commented Aug 25, 2020

can we create one issue per week containing all the repositories in the issue body with checklist example:

repository with more than 1 year without update

but it has a repository with more than a year without updating that must be maintained (quality packages), for this it is ideal to have a white list to not appear in all issues

@mrKappen
Copy link
Collaborator Author

can we create one issue per week containing all the repositories in the issue body with checklist example:

hmm. When you say create an issue once a week, will the script be constantly running (never exiting) and simply send a request to create an issue every week? What I had in mind was that there would be a job that runs every week or so that executes that whole script.

@avelino
Copy link
Owner

avelino commented Aug 25, 2020

cronjob (like github actions) executed 1 times a week so as not to generate too many issues and end up being unfeasible to review

@mrKappen
Copy link
Collaborator Author

mrKappen commented Aug 26, 2020

@avelino I updated the script to create a single issue each time the script is run with a checklist of all flagged repo links. Only new repositories (defined as not being referenced in a currently open issue) is added

@avelino avelino mentioned this pull request Aug 26, 2020
@mrKappen
Copy link
Collaborator Author

@avelino check for dead links added as well

@mrKappen
Copy link
Collaborator Author

mrKappen commented Sep 3, 2020

Hi @avelino I added a workflow, but I seem unable to test it on my fork. The action does not appear on github's actions tab. Is there a requirement that the yaml file has to be on the master branch?

.github/workflows/run-check.yaml Outdated Show resolved Hide resolved
jobs:
build:
name: Running test
runs-on: windows-latest
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why run on windows?

query := startQuery()
var staleRepos []string
addressedRepositories := make(map[string]bool)
oauth := os.Getenv("GITHUB_OAUTH_TOKEN")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as variable environment setting in github workflow GITHUB_OAUTH_TOKEN

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added environment variable OAUTH_TOKEN. @avelino, you need to create a new OAUTH token and create a secret for this repository with the same name

@avelino avelino mentioned this pull request Sep 5, 2020
7 tasks
@github-actions
Copy link

This PR has been automatically marked as closed because it has not had recent activity. They will wait 15 days for your interaction, after that the PR will be closed. Please read more in https://github.com/avelino/awesome-go/blob/master/CONTRIBUTING.md

@github-actions github-actions bot added the stale label Sep 19, 2020
@mrKappen
Copy link
Collaborator Author

Hey @avelino, sorry for the delay. I have added a check for archived repositories.

@avelino avelino merged commit 00ccf89 into avelino:master Sep 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants