Skip to content

Read theme stylesheets through the bundle instead of a jar: URL - #4590

Open
vogella wants to merge 1 commit into
eclipse-platform:masterfrom
vogella:theme-css-no-jar-verify
Open

vogella wants to merge 1 commit into
eclipse-platform:masterfrom
vogella:theme-css-no-jar-verify

Conversation

@vogella

@vogella vogella commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

ThemeEngine.setTheme and the handling of platform: @imports in CSSEngineImpl open a stylesheet through the URL that FileLocator.resolve returns, which for a jarred bundle is a jar: URL. Reading through a JarURLConnection makes the JDK verify the signature of the whole jar on first access, so every signed bundle that contributes a stylesheet, such as egit.ui with egit.css, pays a signature check on the main thread during startup. In a startup profile this was about 30 main-thread samples, roughly 150 to 180 ms on a heavily loaded machine. The stream is now opened from the unresolved URL, which reads through the bundle, while the resolved URL is still passed on as the stylesheet location for resolving relative imports, so the parsed styling is unchanged.

Opening the resolved jar: URL makes the JDK verify the signature of the whole jar on first access, which costs noticeable startup time for every signed bundle that contributes a stylesheet. The stylesheet is now read from its unresolved URL; the resolved URL is still used as the base for relative imports.

Assisted-by: multiple AI agents and layers of automated tooling 🤖
@github-actions

Copy link
Copy Markdown
Contributor

Test Results

   867 files  ±0     867 suites  ±0   41m 49s ⏱️ - 18m 18s
 8 567 tests ±0   8 327 ✅ ±0  240 💤 ±0  0 ❌ ±0 
21 573 runs  ±0  20 900 ✅ ±0  673 💤 ±0  0 ❌ ±0 

Results for commit 63ba468. ± Comparison against base commit 50268ca.

@laeubi

laeubi commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

While the change itself might be fine, given we already check signatures at install time, I would like to raise a more general concern.

You currently have 67 open PRs across swt, platform.ui, platform and ui-best-practices, about a quarter of all 275 open PRs in the organisation. The next contributor has 14.

Since Nov 1 you opened 100 PRs, and 62 were merged, 52 of them by yourself. Of those 62, 46 had no review from another human (bots not counted), and 36 had neither a review nor a comment.

Nothing in CONTRIBUTING.md forbids this, and the changes may well be fine. But at this pace it is hard for other committers to see what is about to be finished, what has already landed, and to keep up.

I would like to ask you to hold back future work in your fork, similar to what we already ask for AI iteration, and open new PRs once earlier ones are merged, ideally after another committer had a chance to look. You could also use some of that time to help other PRs get done, e.g. the older ones from other contributors. The Eclipse Project Handbook lists reviewing contributions among the committer responsibilities, and asks that AI output goes through the normal vetting process.

I would rather not introduce a hard limit and instead trust committers' judgement, so this is a request, not a rule.

Would you be fine with trying a handful of open PRs at a time? If you see a better approach, I am happy to hear it.

@vogella

vogella commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

Our long freeze periods are usually bad for keeping the open prs small.

I'm planning to reduce the number of open prs as soon as master opens up and by publishing them early interested people have a chance to find a fitting time to review.

@akurtakov

Copy link
Copy Markdown
Member

In my view the problem isn't that one person contributes too much. It's that too few people review. Limiting how much active contributors can open would punish exactly the proactive work the project needs, and it won't create reviewers. In practice, waiting for reviews mostly means PRs sit idle, because reviews rarely happen unless you ask someone directly. Given how many PRs from non-committers are waiting, those should get priority anyway. I'd rather fix this at the system level than single out anyone. Nobody should have to explain how they spend their time, but the project can reasonably expect every committer to share the review work. I don't think a recommendation will change anything, because suggestions get ignored. So I'd propose a formal rule, such as a minimum number of reviews per release cycle to keep committer status, that being mandatory to remain committer. A rule like that should be agreed by the committers, at least by majority vote, before it takes effect, am I right @waynebeaton ?

@merks

merks commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Let me ask a more general question: Would it have been possible to hold back this change in your fork and open a PR later after master has opened again?

I ask because I expect later you will need to rebase this PR to ensure that any required version increments are applied for the subsequent release cycle. That will run this entire set of builds again. I expect that's true for every already-open PR. I expect to see a large influx of emails and a lot of builds cycles burning away the shared pool of resource, including interrupts and force pushes for the version increments themselves. In practice we multiply this by several dozen PRs of this form. And in principle, if we had a dozen people doing this, we'd find our inboxes constantly full. We'd learn to ignore any and all notifications as just too much noise.

There needs to be a way to avoid this.

@akurtakov

Copy link
Copy Markdown
Member

Now, that's a good request to save some infra usage. I would appreciate this being written down in contributing docs and maybe as a general instruction to agents to avoid opening PRs during freeze period (calendar is public!) , one can always do it manually if it's smth to be considered during freeze .

@vogella

vogella commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

In my view the problem isn't that one person contributes too much. It's that too few people review. Limiting how much active contributors can open would punish exactly the proactive work the project needs, and it won't create reviewers. In practice, waiting for reviews mostly means PRs sit idle, because reviews rarely happen unless you ask someone directly. Given how many PRs from non-committers are waiting, those should get priority anyway. I'd rather fix this at the system level than single out anyone. Nobody should have to explain how they spend their time, but the project can reasonably expect every committer to share the review work. I don't think a recommendation will change anything, because suggestions get ignored. So I'd propose a formal rule, such as a minimum number of reviews per release cycle to keep committer status, that being mandatory to remain committer. A rule like that should be agreed by the committers, at least by majority vote, before it takes effect, am I right @waynebeaton ?

Copilot reviews have been very useful in the past. That would be a great prep for non-committer PR before we invest personal time into them.

Unfortunately a copilot review generates additional email traffic. Mandatory and automatic copilot reviews without email notification would be highly benefical IMHO. Also the usage of Copilot for committers is very limited so doing Copilot reviews for non-committers should be done with a different account.

I assume the following flow would be very helpful:

Non-Committer PR -> Automatic Copilot review without email -> once green -> Committer share the work to look at them.

Of course this does not have to be limited to non-committers PRs.

@vogella

vogella commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

Let me ask a more general question: Would it have been possible to hold back this change in your fork and open a PR later after master has opened again?

I will try to reduce contribution of non critical performance fixes and bug fixes until master opens.

FYI - I do hold back a lot of changes already. For example in SWT I have currently ~140 bugs fixes plus the FFM finished work in my fork which have not been contributed yet and in another repo I have approx ~3000 additional tests, which I think would also be benefical to swt.

@vogella

vogella commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

Now, that's a good request to save some infra usage. I would appreciate this being written down in contributing docs and maybe as a general instruction to agents to avoid opening PRs during freeze period (calendar is public!) , one can always do it manually if it's smth to be considered during freeze .

That would reduce even more our development and review window of open prs and would give people less time to review prs.

I think it would be better to switch after M3 to a new master andand do RC1 and RC2 from the maintenance branch. Currently we are heading backwards in "lets not hinder the development flow" which we started by not freezing during M1, M2, M3 week.

How many RC1 / RC2 contributions did we have? 2? Maybe 5? And we are effectively freezing master for weeks.

@iloveeclipse

Copy link
Copy Markdown
Member

I think it would be better to switch after M3 to a new master andand do RC1 and RC2 from the maintenance branch.

see eclipse-platform/eclipse.platform.releng.aggregator#863

I personally would like this.

@merks

merks commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

FYI

eclipse-platform/.github#282

@vogella

vogella commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor Author

In my view the problem isn't that one person contributes too much. It's that too few people review. Limiting how much active contributors can open would punish exactly the proactive work the project needs, and it won't create reviewers. In practice, waiting for reviews mostly means PRs sit idle, because reviews rarely happen unless you ask someone directly. Given how many PRs from non-committers are waiting, those should get priority anyway. I'd rather fix this at the system level than single out anyone. Nobody should have to explain how they spend their time, but the project can reasonably expect every committer to share the review work. I don't think a recommendation will change anything, because suggestions get ignored. So I'd propose a formal rule, such as a minimum number of reviews per release cycle to keep committer status, that being mandatory to remain committer. A rule like that should be agreed by the committers, at least by majority vote, before it takes effect, am I right @waynebeaton ?

Some statistics to that proposal. Unless my extraction script (see below) has an error, we have only a few committers who would archive the target.

2026-08-27 to 2026-11-26 · 8 repositories: eclipse-pde/eclipse.pde, eclipse-platform/.github, eclipse-platform/eclipse.platform, eclipse-platform/eclipse.platform.releng.aggregator, eclipse-platform/eclipse.platform.swt, eclipse-platform/eclipse.platform.ui, eclipse-platform/ui-best-practices, eclipse-platform/www.eclipse.org-eclipse

Bildschirmfoto 2026-11-26 um 11 24 19

Python script to get the data I used to create the report. A review is any review, review comment, PR comment or merge in the window. A person counts once per PR; the PR author and bots are left out.

collect_review_data.py

#!/usr/bin/env python3
"""
Collect the review activity on pull requests in GitHub repositories, by default
those of the Eclipse Platform and PDE organizations, into one JSON file.

For every PR updated in the time window it records the PR (author, state,
creation and merge time) and each review, review comment, PR comment and merge
dated inside the window, with who did it. Committer lists of the Eclipse
projects come from the Eclipse PMI API unless --no-pmi.

Only the Python 3.9+ standard library is needed.
Token: $GITHUB_TOKEN, $GH_TOKEN, or gh auth token; read access to public
repositories is enough.

Examples:
python3 collect_review_data.py # last 91 days, both orgs
python3 collect_review_data.py --days 30 --out data.json
python3 collect_review_data.py --since 2026-08-25 --until 2026-11-25
python3 collect_review_data.py --repos eclipse-platform/eclipse.platform.ui,eclipse-pde/eclipse.pde

Output: {"since", "until", "generated_at", "orgs", "repos", "skipped",
"committers": {org: [github logins] or null}, "committer_source": [...],
"prs": [{"repo", "number", "title", "author", "author_is_bot",
"author_association", "url", "created_at", "state", "merged_at",
"events": [[login, author_association, kind, time], ...]}]}
kind is comment, review_comment, review_ or merged.
"""
import argparse
import concurrent.futures
import datetime as dt
import json
import os
import re
import subprocess
import sys
import time
import urllib.error
import urllib.parse
import urllib.request

API = "https://api.github.com"
ORG_TO_PMI_PROJECT = {
"eclipse-platform": "eclipse.platform",
"eclipse-pde": "eclipse.pde",
}
EXTRA_BOTS = {"eclipse-platform-bot", "eclipse-pde-bot", "eclipse-releng-bot",
"eclipse-eca-validation", "eclipsewebmaster", "copilot",
"copilot-pull-request-reviewer"}

def log(*a):
print(*a, file=sys.stderr, flush=True)

def get_token():
for var in ("GITHUB_TOKEN", "GH_TOKEN"):
if os.environ.get(var):
return os.environ[var]
try:
return subprocess.check_output(["gh", "auth", "token"], text=True).strip()
except Exception:
sys.exit("No token: set GITHUB_TOKEN or log in with gh auth login.")

class GitHub:
def init(self, token):
self.token = token
self.calls = 0

def _request(self, url):
    for attempt in range(6):
        req = urllib.request.Request(url, headers={
            "Authorization": f"Bearer {self.token}",
            "Accept": "application/vnd.github+json",
            "X-GitHub-Api-Version": "2022-11-28",
            "User-Agent": "review-stats-script",
        })
        try:
            with urllib.request.urlopen(req, timeout=60) as r:
                self.calls += 1
                return json.load(r), r.headers
        except urllib.error.HTTPError as e:
            remaining = e.headers.get("X-RateLimit-Remaining")
            body = e.read().decode("utf-8", "replace").lower() if e.code in (403, 429) else ""
            if e.code in (403, 429) and "rate limit" in body and remaining != "0" and not e.headers.get("Retry-After"):
                log(f"  secondary rate limit, sleeping {60 * (attempt + 1)}s")
                time.sleep(60 * (attempt + 1))
                continue
            if e.code in (403, 429) and (remaining == "0" or e.headers.get("Retry-After")):
                reset = int(e.headers.get("X-RateLimit-Reset", time.time() + 60))
                wait = int(e.headers.get("Retry-After") or max(5, reset - time.time() + 2))
                log(f"  rate limited, sleeping {wait}s")
                time.sleep(min(wait, 3700))
                continue
            if e.code >= 500:
                time.sleep(2 ** attempt)
                continue
            raise
        except (urllib.error.URLError, TimeoutError):
            time.sleep(2 ** attempt)
    raise RuntimeError(f"giving up on {url}")

def graphql(self, query):
    for attempt in range(6):
        req = urllib.request.Request(API + "/graphql", data=json.dumps({"query": query}).encode(), headers={
            "Authorization": f"Bearer {self.token}", "User-Agent": "review-stats-script",
            "Content-Type": "application/json"})
        try:
            with urllib.request.urlopen(req, timeout=60) as r:
                self.calls += 1
                data = json.load(r)
        except urllib.error.HTTPError as e:
            if e.code in (403, 429) or e.code >= 500:
                time.sleep(60 * (attempt + 1) if e.code in (403, 429) else 2 ** attempt)
                continue
            raise
        except (urllib.error.URLError, TimeoutError):
            time.sleep(2 ** attempt)
            continue
        if data.get("errors") and not data.get("data"):
            raise RuntimeError(f"GraphQL: {data['errors'][0].get('message')}")
        return data["data"]
    raise RuntimeError("giving up on GraphQL query")

def get(self, path, params=None):
    url = path if path.startswith("http") else API + path
    if params:
        url += ("&" if "?" in url else "?") + urllib.parse.urlencode(params)
    return self._request(url)[0]

def paginate(self, path, params=None, items_key=None):
    params = dict(params or {})
    params.setdefault("per_page", 100)
    url = API + path + "?" + urllib.parse.urlencode(params)
    while url:
        data, headers = self._request(url)
        yield from (data[items_key] if items_key else data)
        m = re.search(r'<([^>]+)>;\s*rel="next"', headers.get("Link", ""))
        url = m.group(1) if m else None

def iso(ts):
return dt.datetime.fromisoformat(ts.replace("Z", "+00:00"))

def is_bot(user):
if not user:
return True
login = user.get("login", "").lower()
return (user.get("type") == "Bot" or login.endswith("[bot]")
or login.endswith("-bot") or login in EXTRA_BOTS)

---------------------------------------------------------------- committers

def http_json(url):
req = urllib.request.Request(url, headers={"User-Agent": "review-stats-script",
"Accept": "application/json"})
with urllib.request.urlopen(req, timeout=60) as r:
return json.load(r)

def pmi_committers(project_id, cache):
"""GitHub logins (lower case) of the committers of an Eclipse project."""
data = http_json(f"https://projects.eclipse.org/api/projects/{project_id}.json")
if isinstance(data, list):
data = data[0]
logins = set()
for c in data.get("committers", []):
user = c.get("username")
if not user:
continue
if user not in cache:
try:
prof = http_json(f"https://api.eclipse.org/account/profile/{urllib.parse.quote(user)}")
cache[user] = (prof.get("github_handle") or "").lower()
except Exception as e:
log(f" profile lookup failed for {user}: {e}")
cache[user] = ""
if cache[user]:
logins.add(cache[user])
return logins

---------------------------------------------------------------- collection

def list_repos(gh, orgs):
repos = []
for org in orgs:
for r in gh.paginate(f"/orgs/{org}/repos", {"type": "public"}):
if not r.get("archived"):
repos.append(r["full_name"])
return repos

def search_prs(gh, repo, since, until):
"""PRs in repo updated in [since, until]; splits the range if >1000 hits."""
q = f"repo:{repo} is:pr updated:{since:%Y-%m-%dT%H:%M:%SZ}..{until:%Y-%m-%dT%H:%M:%SZ}"
first = gh.get("/search/issues", {"q": q, "per_page": 1})
if first["total_count"] > 1000 and (until - since) > dt.timedelta(hours=1):
mid = since + (until - since) / 2
return search_prs(gh, repo, since, mid) + search_prs(gh, repo, mid, until)
out = []
for it in gh.paginate("/search/issues", {"q": q}, items_key="items"):
out.append(it)
time.sleep(0.1)
time.sleep(2) # search API: 30 requests per minute
return out

def collect_repo(gh, repo, since, until, now, workers):
prs = {it["number"]: {
"repo": repo,
"number": it["number"],
"title": it["title"],
"author": (it.get("user") or {}).get("login", ""),
"author_is_bot": is_bot(it.get("user")),
"author_association": it.get("author_association", "NONE"),
"url": it.get("html_url", ""),
"created_at": it.get("created_at", ""),
"state": ("merged" if (it.get("pull_request") or {}).get("merged_at") else it.get("state", "")),
"merged_at": (it.get("pull_request") or {}).get("merged_at") or "",
"events": [], # (login, association, kind, time)
} for it in search_prs(gh, repo, since, now)}
log(f"{repo}: {len(prs)} PRs updated since {since:%Y-%m-%d}")
if not prs:
return prs

def in_window(ts):
    return ts and since <= iso(ts) < until

def add(num, item, kind, ts_key):
    if num in prs and in_window(item.get(ts_key)) and not is_bot(item.get("user")):
        prs[num]["events"].append((item["user"]["login"], item.get("author_association", "NONE"),
                                   kind, item[ts_key]))

s = since.strftime("%Y-%m-%dT%H:%M:%SZ")
# Repo-wide endpoints: one paged listing instead of one call per PR.
for c in gh.paginate(f"/repos/{repo}/issues/comments", {"since": s, "sort": "created"}):
    add(int(c["issue_url"].rsplit("/", 1)[1]), c, "comment", "created_at")
for c in gh.paginate(f"/repos/{repo}/pulls/comments", {"since": s, "sort": "created"}):
    add(int(c["pull_request_url"].rsplit("/", 1)[1]), c, "review_comment", "created_at")

def reviews(num):
    return num, list(gh.paginate(f"/repos/{repo}/pulls/{num}/reviews"))

with concurrent.futures.ThreadPoolExecutor(workers) as ex:
    for num, revs in ex.map(reviews, list(prs)):
        for r in revs:
            if r.get("state") == "PENDING":
                continue
            add(num, r, "review_" + r.get("state", "").lower(), "submitted_at")

# Merging counts as review activity; GraphQL gets mergedBy for 50 PRs per call.
owner, name = repo.split("/")
merged = [n for n, p in prs.items() if in_window(p["merged_at"])]
for i in range(0, len(merged), 50):
    fields = " ".join(f"p{n}: pullRequest(number: {n}) {{ mergedBy {{ login __typename }} }}"
                      for n in merged[i:i + 50])
    data = gh.graphql(f'{{ repository(owner: "{owner}", name: "{name}") {{ {fields} }} }}')
    for n in merged[i:i + 50]:
        by = ((data.get("repository") or {}).get(f"p{n}") or {}).get("mergedBy")
        if by:
            add(n, {"user": {"login": by["login"], "type": by["__typename"]},
                    "merged_at": prs[n]["merged_at"]}, "merged", "merged_at")
return prs

def parse_window(days, since=None, until=None):
now = dt.datetime.now(dt.timezone.utc).replace(microsecond=0)
end = dt.datetime.fromisoformat(until).replace(tzinfo=dt.timezone.utc) if until else now
start = (dt.datetime.fromisoformat(since).replace(tzinfo=dt.timezone.utc) if since
else end - dt.timedelta(days=days))
if start >= end:
sys.exit("--since must be before --until")
return start, end, now

def collect(orgs, repos, since, until, now, workers=6, no_pmi=False):
"""Everything the report needs, as one JSON-serialisable dict."""
gh = GitHub(get_token())
repos = repos or list_repos(gh, orgs)
log(f"{len(repos)} repositories, window {since:%Y-%m-%d} .. {until:%Y-%m-%d}")
prs, skipped = [], []
for repo in repos:
try:
prs += list(collect_repo(gh, repo, since, until, now, workers).values())
except Exception as e: # one bad repo must not lose the others
log(f"{repo}: skipped ({e})")
skipped.append(f"{repo} ({e})")
log(f"GitHub API calls: {gh.calls}")
orgs = sorted({r.split("/")[0] for r in repos})
committers, sources = committer_lists(orgs, no_pmi)
return {"since": f"{since:%Y-%m-%dT%H:%M:%SZ}", "until": f"{until:%Y-%m-%dT%H:%M:%SZ}",
"generated_at": f"{now:%Y-%m-%dT%H:%M:%SZ}", "orgs": orgs, "repos": repos,
"skipped": skipped, "committers": committers, "committer_source": sources, "prs": prs}

def committer_lists(orgs, no_pmi=False):
"""{org: sorted logins, or None where no PMI list is available} and a source description."""
committers, sources, cache = {}, [], {}
for org in orgs:
project = ORG_TO_PMI_PROJECT.get(org)
committers[org] = None
if no_pmi or not project:
continue
try:
committers[org] = sorted(pmi_committers(project, cache))
sources.append(f"Eclipse PMI ({project}: {len(committers[org])} committers)")
except Exception as e:
log(f"PMI lookup for {project} failed ({e})")
return committers, sources

def main():
ap = argparse.ArgumentParser(description=doc, formatter_class=argparse.RawDescriptionHelpFormatter)
ap.add_argument("--orgs", default="eclipse-platform,eclipse-pde")
ap.add_argument("--repos", help="comma-separated owner/name list instead of all repos of --orgs")
ap.add_argument("--days", type=int, default=91, help="window length in days (default 91)")
ap.add_argument("--since", help="start date YYYY-MM-DD (overrides --days)")
ap.add_argument("--until", help="end date YYYY-MM-DD, exclusive (default now)")
ap.add_argument("--no-pmi", action="store_true", help="skip the Eclipse PMI committer lookup")
ap.add_argument("--workers", type=int, default=6)
ap.add_argument("--out", default="review-data.json")
args = ap.parse_args()
since, until, now = parse_window(args.days, args.since, args.until)
orgs = [o.strip() for o in args.orgs.split(",") if o.strip()]
repos = [r.strip() for r in args.repos.split(",") if r.strip()] if args.repos else None
data = collect(orgs, repos, since, until, now, args.workers, args.no_pmi)
with open(args.out, "w") as f:
json.dump(data, f, indent=1)
log(f"Wrote {args.out}: {len(data['prs'])} PRs")

if name == "main":
main()

@akurtakov

Copy link
Copy Markdown
Member

Given these statistics, for next round I would go for "at least ONE"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants