Граф коммитов

138 Коммитов

Автор SHA1 Сообщение Дата
Mislav Marohnić 61b81bd5aa [ci] Create a non-draft release from annotated tag
If a git tag was annotated, assume that it contains full release notes
and make a public release rather than a draft one.
2019-10-03 02:44:38 +02:00
Mislav Marohnić 75c5410110 [ci] Use `gofmt` to avoid `go fmt` downloading dependencies
`go fmt` doesn't seem to respect `-mod=vendor`
https://github.com/golang/go/issues/27841

Instead try using `gofmt` which doesn't trigger downloading dependencies
in the first place. However, `gofmt` affects files under `vendor/`, so
we reset that before checking for changes.
2019-10-03 01:12:53 +02:00
Mislav Marohnić 994649785d [make] Use GOFLAGS instead of manually passing `-mod=vendor` 2019-10-03 00:51:07 +02:00
Mislav Marohnić a19347a533 [ci] Include `etc` and `share` changes in automatic release notes 2019-09-21 17:29:17 +02:00
Eli Schwartz 7d915e232c
build: pass mod vendoring flag on newer versions of go
When go autodetects that it is being run as a go mod, and that there is
a vendor directory, it will still try to redownload all sources over the
network, unless you use -mod=vendor to tell it to use that. Additionally,
when using -mod=vendor the compiler will nicely avoid messing with
$GOPATH at all, since it can operate in a completely self-contained
manner.

Take advantage of this, when the detected go version is at least 1.11
(when the -mod flag was introduced).
2019-06-15 22:56:33 -04:00
Mislav Marohnić b94fbf9504 [ci] Fix uploading binaries to an existing release 2019-01-26 18:21:01 +01:00
Mislav Marohnić cdd5ce9264 Only publish HTML man pages if the tag is cut off master
[ci skip]
2019-01-18 19:01:31 +01:00
Eli Schwartz 39e1523442 build: respect environment LDFLAGS and strip the build path
golang does not natively respect LDFLAGS, but you can pass them on the
command line using -ldflags=-extldflags=...
This is important for distributions, in order to provide common
functionality such as hardening flags.

Also strip the prefixed root source directory from the embedded source
file paths. This is not important information for the debugger, which
should only care about paths relative to $GOPATH, and results in less
build environment metadata leaking into the final binary. (This also
aids in reproducible builds when using different build directories, see
e.g. https://github.com/golang/go/issues/16860)
2019-01-02 17:00:15 +01:00
Mislav Marohnić f2603ba137 Remove Ruby ronn from build toolchain 2018-12-29 14:33:12 +01:00
Mislav Marohnić cf02dd1118 Switch to new md2roff process in `make man-pages` 2018-12-29 14:33:12 +01:00
Derek P Sifford 93dad3227d add pullrequest vim syntax. #1916 2018-11-12 17:49:11 -05:00
Mislav Marohnić a81bf2bb7d Test install script in CI 2018-06-14 12:04:31 +02:00
Mislav Marohnić 1c5978f36c Extract checking of formatting to shell function 2018-06-14 11:57:23 +02:00
Stephen Gallagher 3ad950799e
Add DESTDIR support for `make install`
When packaging for distributions (particularly RPM), it is common
for the packaging tool to install all of the files into a chroot-
style directory structure as a non-privileged user. This is done
to avoid requiring root privileges for packaging (particularly to
avoid issues where the attempt to package causes changes to be
made to the packaging host.

The standard variable used for this (from autotools) is DESTDIR.
This patch adds DESTDIR before the prefix in install.sh to ensure
that when `make install` is run, it will direct output to the
proper location.

Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
2018-06-13 09:09:26 -04:00
Mislav Marohnić 818224bfa0 Skip `go fmt` CI check for Go 1.8
`go fmt ./...` affects the `vendor/` directory before Go 1.9.
2018-06-09 18:17:54 +02:00
Mislav Marohnić f650a22525 Extract code coverage summary to its own script 2018-06-09 18:10:52 +02:00
Mislav Marohnić 00e1b9957d Remove obsolete build steps
This was from the time when we tried to have hub build even if it wasn't
checkout out within a local GOPATH. This change assumes a working Go
environment.
2018-06-08 20:57:27 +02:00
Mislav Marohnić 2710e66efc Merge branch 'release-docs' 2018-06-07 20:11:08 +02:00
Mislav Marohnić 802542d713 Support floating point minimum coverage treshold 2018-06-07 17:46:35 +02:00
Mislav Marohnić ca5a340ddb Fix recording code coverage around conditionals 2018-06-07 16:59:43 +02:00
Mislav Marohnić 45e575e759 Enable passing list of cukes to `script/test` for faster runs 2018-06-07 16:07:20 +02:00
Mislav Marohnić ca87a5116e Measure code coverage between tests
Go has code coverage tooling for test mode, which temporarily rewrites
the source code to insert annotations which will activate during the
test run and track progress of executed code. Then, upon process
completion, that information is dumped into a coverage report.

We can't use this approach for hub, at least not without substantial
changes. First of all, hub's test coverage is mostly "from the outside",
utilizing Cucumber to invoke the binary with different arguments and
inspect the outputs and result. There are some tests in go, but they are
minimal compared to the cukes.

Second, hub frequently aborts the process on errors via `os.Exit(1)`,
and those scenarios need to be tested too. However, if the process exits
prematurely, the code coverage report will never be generated.

To work around this, I first used the go tool that annotates the source:

    go tool cover -mode=set -var=LiveCoverage myfile.go

This injects `LiveCoverage.Count[pos] = 1` lines at appropriate places
all over the source code, and generates a mapping of line/column
positions in the original source.

Then I rewrite those lines to become a method invocation:

    coverage.Record(LiveCoverage, pos)

The new `Record` method will immediately append the information to a
code coverage report file as soon as it's invoked. This ensures that
there is coverage information even if the process gets aborted.

This approach works the same for go tests as well as for cukes. They all
append to the same file. Finally, the rest of Go tooling is used to
generate an HTML report of code coverage:

    go tool cover -html=cover.out
2018-06-07 14:44:56 +02:00
Mislav Marohnić db67115e92 Publish man pages to gh-pages on tagged release 2018-06-07 13:01:40 +02:00
Mislav Marohnić f8dec9fc6f Avoid running `publish-release` multiple times per tag
Since there are multiple Go builds, run it only for the latest Go build.
In `.travis.yml`, the latest Go build should appear first in the list.
2018-06-07 12:16:58 +02:00
Mislav Marohnić 945067d771 Avoid `dep` clashing with Bundler
`dep` aggressively prunes everything under `vendor/`. Unfortunately,
this consistently nukes the contents of `vendor/bundle` directory.
2018-01-29 20:59:23 +01:00
Mislav Marohnić 0e32249051 "OS X" → "macOS"
[ci skip]
2018-01-23 19:37:15 +01:00
Mislav Marohnić 76eec4d287 Have CI fail if go code wasn't properly formatted 2018-01-22 22:37:25 +01:00
Michael Kaiser 9ab24975e1 Fix PATH update in windows installation script
Fixes #1506.
2017-10-03 16:27:04 +02:00
Mislav Marohnić 9b4cd74258 Merge pull request #1470 from eljobe/fixes/tmpdir
Remove trailing slashes from the $TMPDIR variable
2017-06-26 20:18:38 +02:00
Mislav Marohnić 0aa5b57338 Enforce go1.8+ at build time 2017-05-17 13:09:00 +02:00
Pepper Lebeck-Jobe a572edb367
Remove comments and extra variables
These were both requested during code review.
2017-05-15 13:10:05 +09:00
Pepper Lebeck-Jobe e3518167df
Address review comments
1. Removed the check_go_version script
2. Only check go version in bootstrap
3. Simplify the go version check logic
2017-05-15 13:03:14 +09:00
Pepper Lebeck-Jobe 71fa8dad8f
Upgrade to Go 1.8
The only thing that has substansively changed is that Go 1.8 handles
redirect logic more safely than previous versions. This means we can
drop our special handling to avoid following redirects to other
domains. We were only doing that to protect against the possibility
of leaking auth headers. With Go 1.8, the auth headers are not
forwarded when following a redirect to another domain, so we don't
need our special handling any more.

As long as people are attempting to build with the Makefile, the new
check_go_version script should cause the build to stop if our
collaborators aren't using at least version 1.8 of go.
2017-05-11 13:24:04 +09:00
Pepper Lebeck-Jobe 1758a6f13b
Remove trailing slashes from the $TMPDIR variable.
This is helpful for when TMPDIR already has a trailing slash. We can't
be sure that it will on all operating systems, but this will remove it
if it is there.
2017-05-09 19:32:14 +09:00
Mislav Marohnić b1c1cbd049 Skip completion tests on Travis new Docker setup
Since we're no longer connected to a tty, we can't start up tmux.
2016-12-08 15:01:59 +01:00
Hariharan R 1b269ea15d don't copy .txt files to man path
on each man hub* commands in the shell, the shell reports
 warning: ignore bogus filename for the respective .txt present
 in the man path.

 copying only the man file to the man path solves this issue.
2016-10-16 23:11:40 -04:00
Mislav Marohnić ef8ac0e2eb Add `make install`
Installs hub binary and man pages into `/usr/local` by default.

Fixes #1291
2016-10-03 20:32:39 +02:00
Mislav Marohnić 7b99de82cb Add ctags configuration, `.agignore` file
Requires universal-ctags
2016-09-13 14:25:14 +02:00
Mislav Marohnić b8c6e06645 Fix Windows installer for OS usernames with spaces
The Windows installer appends the location of `hub.exe` to user's PATH,
but that would break if the OS username has spaces.
2016-09-10 18:42:58 +02:00
Mislav Marohnić d1cb6d7d12 Simplify Travis config and fix release process 2016-08-21 15:57:31 +02:00
Mislav Marohnić b2d567df54 Move man pages to `share/man/man1/` 2016-08-21 14:20:10 +02:00
Mislav Marohnić b4b38abb26 Avoid installing man pages with executable permissions
Fixes #1127
2016-08-07 23:55:56 +02:00
Mislav Marohnić 7c1fedfe90 Upgrade to Go 1.6
The GO15VENDOREXPERIMENT flag is no longer necessary.
2016-08-07 23:55:53 +02:00
Simon Kohlmeyer 4e9d29460a Explicitly specify binstub path in scripts/bootstrap
There might be a bundle config that specifies a different path, which
breaks the build. Explicitly specifying the path changes that.
2016-07-07 10:21:00 +02:00
Mislav Marohnić 32ed6e0358 Implement `script/github-release` with bash + `hub release` 2016-02-01 12:43:47 +11:00
IWriteThings 89f498e369 Need to allow arm and arm64 or else it fails.
This allows the file to compile for arm and arm64.
2016-01-27 07:18:31 -07:00
IWriteThings 67b32c5495 Adding support for arm processors 2016-01-26 07:50:51 -07:00
Mislav Marohnić bfc9228f10 Include all man pages in packaged releases 2016-01-25 22:49:38 +11:00
Mislav Marohnić fa2ba49207 `make fmt` 2016-01-25 17:14:05 +11:00
Mislav Marohnić 54262e6606 Makefile galore! 2016-01-25 15:58:17 +11:00