Page MenuHomeDevCentral

D3735.id9660.diff
No OneTemporary

D3735.id9660.diff

diff --git a/phabricator/analyze-repositories/Makefile b/phabricator/analyze-repositories/Makefile
--- a/phabricator/analyze-repositories/Makefile
+++ b/phabricator/analyze-repositories/Makefile
@@ -4,7 +4,7 @@
all: analyze
repositories.json:
- curl https://${INSTANCE}/api/diffusion.repository.search -d api.token=${TOKEN} -d queryKey=all -d attachments[uris]=1 > repositories.json
+ curl https://${INSTANCE}/api/diffusion.repository.search -d api.token=${TOKEN} -d queryKey=all -d attachments[uris]=1 -d attachments[projects]=1 > repositories.json
analyze: repositories.json
./coherence-check-repositories.py repositories.json
diff --git a/phabricator/analyze-repositories/coherence-check-repositories.py b/phabricator/analyze-repositories/coherence-check-repositories.py
--- a/phabricator/analyze-repositories/coherence-check-repositories.py
+++ b/phabricator/analyze-repositories/coherence-check-repositories.py
@@ -63,6 +63,11 @@
)
)
+ if not has_projects(repository):
+ issues.append(
+ ("projects-missing", f"No project attached. Add here: {settings_url}")
+ )
+
if issues:
app["issues"][repository["fields"]["callsign"]] = issues
@@ -91,6 +96,10 @@
return "https" + url[pos_start:pos_end]
+def has_projects(repository):
+ return len(repository["attachments"]["projects"]["projectPHIDs"]) > 0
+
+
def contains_github_url(repository):
for uri in repository["attachments"]["uris"]["uris"]:
if "github.com/" in uri["fields"]["uri"]["normalized"]:

File Metadata

Mime Type
text/plain
Expires
Mon, Oct 13, 01:38 (14 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3069855
Default Alt Text
D3735.id9660.diff (1 KB)

Event Timeline