jenkinsci / jenkinsci/github-branch-source-plugin

[JENKINS-59318] fill in user-agent with something specific to github-branch-source-plugin

Open
#1,279 1 comment 0 reactions 0 assignees View on GitHub
component:github-branch-source-plugin enhancement imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
217
Forks
398
Avg merge
30m
Merged PRs (30d)
1

Description

There are lots of things that use OkHttp.

OkHttp okhttp#1063 provides a default user-agent, but that does make it easy to figure out what is (ab)using quotas.

It's traditional for clients of libraries to fill in their own useragent (typically embedding their underlying agent w/in the field).

For a general sense of how user-agents are written, please see: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent/Firefox

In general, basically the syntax is:

TokenA/1.1 (platform; information; ...) TokenB/2.3 ... 

The GitHub.com folks reported that the majority of my quota was spent by:

okhttp/2.7.5 

But I can't easily tell if that's:



  1. Some Scala code

  2. Sbt

  3. This jenkins plugin

  4. Some other jenkins plugin

Ideally, the user-agent would be something like:

github-branch-source-plugin/2.5.7 okhttp/2.7.5

If you expect to have issues involving the java version, then including the java version in the UA could be useful...

To get the okhttp version one can do something like:

import com.squareup.okhttp.internal.Version;

Version.userAgent();

---
Originally reported by jsoref, imported from: fill in user-agent with something specific to github-branch-source-plugin


  • status: Open
  • priority: Minor
  • component(s): github-branch-source-plugin
  • resolution: Unresolved
  • votes: 1
  • watchers: 2
  • imported: 2025-12-02

Raw content of original issue

There are lots of things that use OkHttp.

OkHttp okhttp#1063 provides a default user-agent, but that does make it easy to figure out what is (ab)using quotas.

It's traditional for clients of libraries to fill in their own useragent (typically embedding their underlying agent w/in the field).

For a general sense of how user-agents are written, please see: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent/Firefox

In general, basically the syntax is:



TokenA/1.1 (platform; information; ...) TokenB/2.3 ... 


The GitHub.com folks reported that the majority of my quota was spent by:



okhttp/2.7.5 


But I can't easily tell if that's:



  1. Some Scala code

  2. Sbt

  3. This jenkins plugin

  4. Some other jenkins plugin

Ideally, the user-agent would be something like:



github-branch-source-plugin/2.5.7 okhttp/2.7.5


If you expect to have issues involving the java version, then including the java version in the UA could be useful...

To get the okhttp version one can do something like:



import com.squareup.okhttp.internal.Version;

Version.userAgent();

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.