Skip to content

Commit 4fdfd46

Browse files
committed
Stop linking code to a site on its application name alone
A site whose application, or one of its tags, matched a repository's application name had that repository linked as the code behind it. Sites that share an application name do not all run the same code, so that match now scores below the link threshold and shows only as a suggestion with a Link button. The host in the repository's web addresses, web application, diagram or name still links it, as does anything linked by hand.
1 parent fb83069 commit 4fdfd46

4 files changed

Lines changed: 19 additions & 4 deletions

File tree

‎app/core/external.py‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1103,10 +1103,15 @@ def add(repo_id, score, reason):
11031103
for app in self.apps_by_host.get(asset.host, []):
11041104
for repo_id in app["repo_ids"]:
11051105
add(repo_id, 90, f"part of web application {app['name']}, which lists this host")
1106+
# A site's application name, or a tag, that matches a repository's
1107+
# application name is a hint and never a link on its own. Sites that
1108+
# share an application name do not all run the same repositories, so
1109+
# this stays below LINK_THRESHOLD: it shows as suggested, and someone
1110+
# who knows can link it. Other evidence about the host still links.
11061111
names = [asset.application] + [t.tag for t in asset.tags]
11071112
for name in names:
11081113
for repo_id in self.by_app.get((name or "").strip().casefold(), []):
1109-
add(repo_id, 70, f"application {name} matches")
1114+
add(repo_id, LINK_THRESHOLD - 10, f"application {name} matches")
11101115
label = asset.host.split(".")[0]
11111116
stem = _stem(label)
11121117
if len(stem) >= 4:

‎app/web/templates/external_site.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@
429429
<input type="hidden" name="with_fields" value="1">
430430
<label>Application <input type="text" name="application" maxlength="200" value="{{ asset.application }}"></label>
431431
<label>Tags <input type="text" name="tags" maxlength="1000" value="{{ tags | join(', ') }}">
432-
<span class="faint small">Comma separated. A tag that matches a repository's application name links them.</span></label>
432+
<span class="faint small">Comma separated. A tag that matches a repository's application name suggests it, but does not link it.</span></label>
433433
{{ detail_fields(asset, environments, statuses, picks_json, profiles, scan_profiles) }}
434434
<label class="check"><input type="checkbox" name="no_scan" value="1" {{ 'checked' if asset.no_scan }}>
435435
<span>No scan. We are not allowed to scan this host{% if asset.kind == 'domain' %} or anything under it{% endif %}.</span></label>

‎documentation/CHANGELOG.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ moved.
66

77
## 2026-11-10
88

9+
**An application name alone no longer links code to a site.** A site whose
10+
application, or one of its tags, matched a repository's application name had that
11+
repository linked as code behind it. Sites that share an application name do not
12+
all run the same code, so that match is now only a suggestion on the site's page,
13+
with a **Link** button. The host in the repository's web addresses, its web
14+
application, its diagram or its name still links it, and so does anything linked
15+
by hand.
16+
917
**After upgrading, load the curated rules.** Several shipped rules were tightened
1018
and six duplicates were retired, and only loading them brings that in. Rules you
1119
edited yourself are left alone.

‎documentation/external-sites.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,11 +480,13 @@ Worked out on every read, best first:
480480
| A web application the repository is part of lists the host | 90 |
481481
| The host in a diagram's addresses | 80 |
482482
| Another environment of the host is in its web addresses or web application | 75 |
483-
| The site's application or a tag equals the repository's application name | 70 |
484483
| The host's first label, without environment words like dev or stg, equals the repository's name or its application name | 60 |
484+
| The site's application or a tag equals the repository's application name | 50 |
485485
| One contains the other | 40 |
486486

487-
60 and over are linked; below that they are suggestions. **Not this one**
487+
60 and over are linked; below that they are suggestions. A shared application
488+
name alone never links a repository: sites with the same application name do not
489+
all run the same code, so it is offered as a suggestion to link by hand. **Not this one**
488490
hides a link until somebody pins it back, and **Unpin** sends a hand made link
489491
back to being worked out. Only repositories the person can see are offered, so a group
490492
that narrows what someone sees narrows this too.

0 commit comments

Comments
 (0)