<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/gitlab/gitlab-shell.git/client, branch client-identity</title>
<subtitle>gitlab.com: gitlab-org/gitlab-shell.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-shell.git/'/>
<entry>
<title>GitLab API Client support for client certificates</title>
<updated>2020-11-17T04:01:50+00:00</updated>
<author>
<name>Paul Okstad</name>
<email>pokstad@gitlab.com</email>
</author>
<published>2020-11-17T04:01:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-shell.git/commit/?id=b16898c348ad4c110a87695903f8189ffd314033'/>
<id>b16898c348ad4c110a87695903f8189ffd314033</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Log Content-Length bytes in API resposne</title>
<updated>2020-11-03T04:33:52+00:00</updated>
<author>
<name>Stan Hu</name>
<email>stanhu@gmail.com</email>
</author>
<published>2020-11-02T04:52:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-shell.git/commit/?id=6b05bee11e61e27bdd401d9eb6a5f6996c684dcd'/>
<id>6b05bee11e61e27bdd401d9eb6a5f6996c684dcd</id>
<content type='text'>
This will be useful to measure bandwidth sent in response to an API
request, particularly with measuring the /api/v4/internal/lfs endpoint.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This will be useful to measure bandwidth sent in response to an API
request, particularly with measuring the /api/v4/internal/lfs endpoint.
</pre>
</div>
</content>
</entry>
<entry>
<title>tests: Replace assert with require</title>
<updated>2020-10-15T06:44:05+00:00</updated>
<author>
<name>Zeger-Jan van de Weg</name>
<email>git@zjvandeweg.nl</email>
</author>
<published>2020-10-15T06:44:05+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-shell.git/commit/?id=308948b3838c88621e738762241e8d1980881a17'/>
<id>308948b3838c88621e738762241e8d1980881a17</id>
<content type='text'>
Testify features sub packages `assert` and `require`. The difference is
subtle, and lost on novice Golang developers that don't read the docs.
To create a more consistent code base `assert` will no longer be used.

This change was generated by a running a sed command on all `_test.go`
files, followed by `goimports -w`.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Testify features sub packages `assert` and `require`. The difference is
subtle, and lost on novice Golang developers that don't read the docs.
To create a more consistent code base `assert` will no longer be used.

This change was generated by a running a sed command on all `_test.go`
files, followed by `goimports -w`.
</pre>
</div>
</content>
</entry>
<entry>
<title>client: Allow User-Agent header to be overridden</title>
<updated>2020-10-14T15:12:43+00:00</updated>
<author>
<name>Zeger-Jan van de Weg</name>
<email>git@zjvandeweg.nl</email>
</author>
<published>2020-10-14T14:56:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-shell.git/commit/?id=3f03127314bd768efd0bef57915320545afcdd78'/>
<id>3f03127314bd768efd0bef57915320545afcdd78</id>
<content type='text'>
The user agent for requests to the internal API endpoints used the
default Go provided user agent. This change updates that to always set
something else, by default `GitLab-Shell`.

Than for others importing the package, there's a new API to set it to
something else. This has been done with new method, a setter, to
maintain backwards compatibility in the API.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The user agent for requests to the internal API endpoints used the
default Go provided user agent. This change updates that to always set
something else, by default `GitLab-Shell`.

Than for others importing the package, there's a new API to set it to
something else. This has been done with new method, a setter, to
maintain backwards compatibility in the API.
</pre>
</div>
</content>
</entry>
<entry>
<title>Make it possible to propagate correlation ID across processes</title>
<updated>2020-09-21T04:40:40+00:00</updated>
<author>
<name>Stan Hu</name>
<email>stanhu@gmail.com</email>
</author>
<published>2020-09-19T10:34:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-shell.git/commit/?id=a487572a904cc149840488eefdfe121173d8bcb5'/>
<id>a487572a904cc149840488eefdfe121173d8bcb5</id>
<content type='text'>
Previously, gitlab-shell did not pass a context through the application.
Correlation IDs were generated down the call stack instead of passed
around from the start execution.

This has several potential downsides:

1. It's easier for programming mistakes to be made in future that lead
to multiple correlation IDs being generated for a single request.
2. Correlation IDs cannot be passed in from upstream requests
3. Other advantages of context passing, such as distributed tracing is
not possible.

This commit changes the behavior:

1. Extract the correlation ID from the environment at the start of
the application.
2. If no correlation ID exists, generate a random one.
3. Pass the correlation ID to the GitLabNet API requests.

This change also enables other clients of GitLabNet (e.g. Gitaly) to
pass along the correlation ID in the internal API requests
(https://gitlab.com/gitlab-org/gitaly/-/issues/2725).

Fixes https://gitlab.com/gitlab-org/gitlab-shell/-/issues/474
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, gitlab-shell did not pass a context through the application.
Correlation IDs were generated down the call stack instead of passed
around from the start execution.

This has several potential downsides:

1. It's easier for programming mistakes to be made in future that lead
to multiple correlation IDs being generated for a single request.
2. Correlation IDs cannot be passed in from upstream requests
3. Other advantages of context passing, such as distributed tracing is
not possible.

This commit changes the behavior:

1. Extract the correlation ID from the environment at the start of
the application.
2. If no correlation ID exists, generate a random one.
3. Pass the correlation ID to the GitLabNet API requests.

This change also enables other clients of GitLabNet (e.g. Gitaly) to
pass along the correlation ID in the internal API requests
(https://gitlab.com/gitlab-org/gitaly/-/issues/2725).

Fixes https://gitlab.com/gitlab-org/gitlab-shell/-/issues/474
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix gitlab-shell not handling relative URLs over UNIX sockets</title>
<updated>2020-08-20T23:54:36+00:00</updated>
<author>
<name>Stan Hu</name>
<email>stanhu@gmail.com</email>
</author>
<published>2020-08-18T05:19:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-shell.git/commit/?id=eb3b35b9b0cc55fb8464d9b0662e6b94aafc54cc'/>
<id>eb3b35b9b0cc55fb8464d9b0662e6b94aafc54cc</id>
<content type='text'>
From
https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/4498#note_397401883,
if you specify a relative path such as:

```
external_url 'http://gitlab.example.com/gitlab'
```

gitlab-shell doesn't have a way to pass the `/gitlab` to the host. For example, let's say we have:

```
gitlab_url: "http+unix://%2Fvar%2Fopt%2Fgitlab%2Fgitlab-workhorse%2Fsocket"
```

If we have `/gitlab` as the relative path, how do we specify what is the
UNIX socket path and what is the relative path? If we specify:

```
gitlab_url: "http+unix:///var/opt/gitlab/gitlab-workhorse.socket/gitlab
```

This is ambiguous. Is the socket in
`/var/opt/gitlab/gitlab-workhorse.socket/gitlab` or in
`/var/opt/gitlab/gitlab-workhorse.socket`?

To fix this, this merge request adds an optional
`gitlab_relative_url_root` config parameter:

```
gitlab_url: "http+unix://%2Fvar%2Fopt%2Fgitlab%2Fgitlab-workhorse%2Fsocket"
gitlab_relative_url_root: /gitlab
```

This is only used with UNIX domain sockets to disambiguate the socket
and base URL path. If `gitlab_url` uses `http://` or `https://`, then
`gitlab_relative_url_root` is ignored.

Relates to https://gitlab.com/gitlab-org/gitlab-shell/-/issues/476
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
From
https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/4498#note_397401883,
if you specify a relative path such as:

```
external_url 'http://gitlab.example.com/gitlab'
```

gitlab-shell doesn't have a way to pass the `/gitlab` to the host. For example, let's say we have:

```
gitlab_url: "http+unix://%2Fvar%2Fopt%2Fgitlab%2Fgitlab-workhorse%2Fsocket"
```

If we have `/gitlab` as the relative path, how do we specify what is the
UNIX socket path and what is the relative path? If we specify:

```
gitlab_url: "http+unix:///var/opt/gitlab/gitlab-workhorse.socket/gitlab
```

This is ambiguous. Is the socket in
`/var/opt/gitlab/gitlab-workhorse.socket/gitlab` or in
`/var/opt/gitlab/gitlab-workhorse.socket`?

To fix this, this merge request adds an optional
`gitlab_relative_url_root` config parameter:

```
gitlab_url: "http+unix://%2Fvar%2Fopt%2Fgitlab%2Fgitlab-workhorse%2Fsocket"
gitlab_relative_url_root: /gitlab
```

This is only used with UNIX domain sockets to disambiguate the socket
and base URL path. If `gitlab_url` uses `http://` or `https://`, then
`gitlab_relative_url_root` is ignored.

Relates to https://gitlab.com/gitlab-org/gitlab-shell/-/issues/476
</pre>
</div>
</content>
</entry>
<entry>
<title>Generate and log correlation IDs</title>
<updated>2020-07-31T12:58:42+00:00</updated>
<author>
<name>Stan Hu</name>
<email>stanhu@gmail.com</email>
</author>
<published>2020-07-31T12:58:42+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-shell.git/commit/?id=87402ed127d9855b8123e5e08a4c89d373cc79e8'/>
<id>87402ed127d9855b8123e5e08a4c89d373cc79e8</id>
<content type='text'>
This will make it easier to tie an SSH access request to Rails API and
Gitaly requests.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This will make it easier to tie an SSH access request to Rails API and
Gitaly requests.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix race conditions with logrus testing</title>
<updated>2020-05-12T05:31:13+00:00</updated>
<author>
<name>Stan Hu</name>
<email>stanhu@gmail.com</email>
</author>
<published>2020-05-12T05:02:58+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-shell.git/commit/?id=0372634076cdfd7cda740cd040e16e629ea662e4'/>
<id>0372634076cdfd7cda740cd040e16e629ea662e4</id>
<content type='text'>
logrus fires a Goroutine to write logs, so the tests could fail if they
checked the event queue before the logrus have fired.  Since there isn't
an easy way to flush all outstanding hooks, we just retry every 100 ms
for up to a second for log to arrive in the queue.

Closes https://gitlab.com/gitlab-org/gitlab-shell/-/issues/450
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
logrus fires a Goroutine to write logs, so the tests could fail if they
checked the event queue before the logrus have fired.  Since there isn't
an easy way to flush all outstanding hooks, we just retry every 100 ms
for up to a second for log to arrive in the queue.

Closes https://gitlab.com/gitlab-org/gitlab-shell/-/issues/450
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix race conditions in tests</title>
<updated>2020-05-08T22:40:18+00:00</updated>
<author>
<name>Stan Hu</name>
<email>stanhu@gmail.com</email>
</author>
<published>2020-05-08T22:40:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-shell.git/commit/?id=c0cf314c5722a4f7ec0a1f355d23fa2511344989'/>
<id>c0cf314c5722a4f7ec0a1f355d23fa2511344989</id>
<content type='text'>
Calling logrus hook.LastEntry() can lead to race conditions.  Use
AllEntries instead:
https://github.com/sirupsen/logrus/blob/60c74ad9be0d874af0ab0daef6ab07c5c5911f0d/hooks/test/test.go#L77

Closes https://gitlab.com/gitlab-org/gitlab-shell/-/issues/450
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Calling logrus hook.LastEntry() can lead to race conditions.  Use
AllEntries instead:
https://github.com/sirupsen/logrus/blob/60c74ad9be0d874af0ab0daef6ab07c5c5911f0d/hooks/test/test.go#L77

Closes https://gitlab.com/gitlab-org/gitlab-shell/-/issues/450
</pre>
</div>
</content>
</entry>
<entry>
<title>Add HTTP status code to internal API logs</title>
<updated>2020-05-08T21:59:35+00:00</updated>
<author>
<name>Stan Hu</name>
<email>stanhu@gmail.com</email>
</author>
<published>2020-05-08T21:56:36+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-shell.git/commit/?id=1adadc2e299529e805aae3dac7c2579b88c8dae7'/>
<id>1adadc2e299529e805aae3dac7c2579b88c8dae7</id>
<content type='text'>
This would make it easier to filter the logs by status code.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This would make it easier to filter the logs by status code.
</pre>
</div>
</content>
</entry>
</feed>
