mirror of
https://github.com/discourse/discourse.git
synced 2026-08-08 17:53:55 +08:00
### Why Saving `github_linkback_access_token` validates the token against every repository listed in `github_badges_repos`, and saving `github_badges_repos` validates the format of each entry. When one entry failed, both validators returned a generic error: - _"You must provide a valid GitHub linkback access token which has access to the badge repositories you have provided."_ - _"You must provide a GitHub URL or the repository name in the format github_user/repository_name"_ Neither message said **which** repository was at fault. On a site with a long list of repositories, an admin had no way to identify the offending entry from the UI and had to run a console script to find it. ### What changed Both validators now capture the first failing entry and interpolate its name into the error message, so the problem repository can be fixed straight from the settings page, e.g.: > The GitHub linkback access token could not access the 'acme/private-repo' repository. Make sure the token is valid and that the repository name is correct and accessible. > 'not a repo' is not a valid GitHub URL or repository name. Use the format github_user/repository_name. The generic messages are kept as a fallback. While reworking the token validator, a repository that is missing or private (GitHub answers both with a `404`) was previously left unrescued and turned the save into a `500`. That case is now treated as a validation failure, alongside an unauthorized (`401`) token, and reported with the same repository-naming message. ### Testing Added specs covering the `401` and `404` paths for the token validator and the "name the first invalid entry" path for the badges-repo validator, plus the generic-message fallback for both.
63 lines
4.1 KiB
YAML
Vendored
63 lines
4.1 KiB
YAML
Vendored
en:
|
|
site_settings:
|
|
enable_discourse_github_plugin: "Enable the discourse-github plugin"
|
|
github_linkback_enabled: "Link GitHub issues back to forum discussions"
|
|
github_linkback_projects: "List of projects to link back from"
|
|
github_linkback_access_token: 'A valid access token for the user who will post the linkback and for counting commits/contributions to grant badges. See <a href="https://meta.discourse.org/t/99895">here</a> for instructions on how to get a token.'
|
|
github_linkback_maximum_links: "Maximum number of linkbacks to create from one single post. When a post contains more links, none is created."
|
|
github_permalinks_enabled: "Enable GitHub permalink overwrites"
|
|
github_pr_status_enabled: "Show GitHub pull request status on oneboxes (draft, open, approved, merged, closed)"
|
|
github_webhook_secret: "Secret token for GitHub webhook signature verification. Configure this value in your GitHub webhook settings."
|
|
github_permalinks_exclude: "Filename or directory that should be excluded from permalink overwrites. Provide only filename or full path: user/repository/optional-directory/filename"
|
|
github_badges_enabled: "Enable GitHub badges"
|
|
github_badges_repos: "URLs of the GitHub repos to scan for contributions and commits"
|
|
github_silver_badge_min_commits: "Minimum number of commits for silver badge"
|
|
github_gold_badge_min_commits: "Minimum number of commits for gold badge"
|
|
|
|
errors:
|
|
invalid_badge_repo: "You must provide a GitHub URL or the repository name in the format github_user/repository_name"
|
|
invalid_badge_repo_value: "'%{repo}' is not a valid GitHub URL or repository name. Use the format github_user/repository_name."
|
|
invalid_github_linkback_access_token: "You must provide a valid GitHub linkback access token which has access to the badge repositories you have provided."
|
|
invalid_github_linkback_access_token_for_repo: "The GitHub linkback access token could not access the '%{repo}' repository. Make sure the token is valid and that the repository name is correct and accessible."
|
|
|
|
github_linkback:
|
|
commit_template: |
|
|
This commit has been mentioned on **%{title}**. There might be relevant details there:
|
|
|
|
%{post_url}
|
|
pr_template: |
|
|
This pull request has been mentioned on **%{title}**. There might be relevant details there:
|
|
|
|
%{post_url}
|
|
issue_template: |
|
|
This issue has been mentioned on **%{title}**. There might be relevant details there:
|
|
|
|
%{post_url}
|
|
github_commits_populator:
|
|
errors:
|
|
repository_identifier_invalid_pm_title: "Action required for discourse-github plugin"
|
|
repository_identifier_invalid_pm: |
|
|
A repository specified in the discourse-github plugin is invalid:
|
|
%{repo_name}
|
|
|
|
They should be specified as `user/repo`.
|
|
|
|
Badges will not be awarded until the name is corrected in
|
|
<a href="%{base_path}/admin/site_settings/category/plugins?filter=GitHub">discourse-github Site Settings</a>
|
|
and "github_badges_enabled" is turned back on.
|
|
repository_not_found_pm_title: "Action required for discourse-github plugin"
|
|
repository_not_found_pm: |
|
|
A repository specified in the discourse-github plugin returned a "Not Found"
|
|
error: %{repo_name}
|
|
|
|
Badges will not be awarded until the name is corrected in
|
|
<a href="%{base_path}/admin/site_settings/category/plugins?filter=GitHub">discourse-github Site Settings</a>
|
|
and "github_badges_enabled" is turned back on.
|
|
invalid_octokit_credentials_pm_title: "Action required for discourse-github plugin"
|
|
invalid_octokit_credentials_pm: |
|
|
The GitHub credentials provided to the discourse-github plugin are invalid. The "github badges enabled\ site
|
|
setting has been disabled, and commits will no longer be populated until the issue is resolved.
|
|
|
|
Check your "github linkback access token" site setting to ensure the token is correct and has permission to all
|
|
repos via
|
|
<a href="%{base_path}/admin/site_settings/category/plugins?filter=GitHub">discourse-github Site Settings</a>.
|