-
-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
Conversation
Thank you for contributing with awesome-go, we will revise your contribution as soon as possible. Automation body links content check:
|
test_stale_repositories.go
Outdated
} | ||
buf := new(bytes.Buffer) | ||
json.NewEncoder(buf).Encode(body) | ||
req, err := http.NewRequest("POST", githubPOSTISSUES, buf) |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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
test_stale_repositories.go
Outdated
"golang.org/x/oauth2" | ||
) | ||
|
||
var reGithubRepo = regexp.MustCompile("https://github.com/[a-zA-Z0-9-.]+/[a-zA-Z0-9-.]+$") |
There was a problem hiding this comment.
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
- ...
There was a problem hiding this comment.
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)...) |
There was a problem hiding this comment.
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))
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) |
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 |
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 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 check for dead links added as well |
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
jobs: | ||
build: | ||
name: Running test | ||
runs-on: windows-latest |
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
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 |
Hey @avelino, sorry for the delay. I have added a check for archived repositories. |
ref: #3211