Browse Source

Warn that org might not have access when hook setup fails

Jordi Boggiano 6 years ago
parent
commit
a12fc77af2

+ 1 - 1
app/Resources/FOSUserBundle/views/Profile/show.html.twig

@@ -33,7 +33,7 @@
                 {% if githubSync.result.results.hooks_failed|length > 0 %}
                     <h4>Hooks setup failures</h4>
                     {% for fail in githubSync.result.results.hooks_failed %}
-                        <p><a href="{{ path('view_package', {name: fail.package}) }}">{{ fail.package }}</a> {{ fail.reason }}</p>
+                        <p><a href="{{ path('view_package', {name: fail.package}) }}">{{ fail.package }}</a> {{ fail.reason|raw }}</p>
                     {% endfor %}
                 {% endif %}
             {% endif %}

+ 2 - 2
src/Packagist/WebBundle/Service/GitHubUserMigrationWorker.php

@@ -240,11 +240,11 @@ class GitHubUserMigrationWorker
     {
         // repo not found probably means the user does not have admin access to it on github
         if ($e->getCode() === 404) {
-            return 'GitHub user has no admin access to repository';
+            return 'GitHub user has no admin access to the repository, or Packagist was not granted access to the organization (<a href="https://github.com/settings/connections/applications/a059f127e1c09c04aa5a">check here</a>)';
         }
 
         if ($e->getCode() === 403 && strpos($e->getMessage(), 'Repository was archived so is read-only') !== false) {
-            return 'Repository is archived and read-only';
+            return 'The repository is archived and read-only';
         }
 
         return false;