From e29aace1e6c09865516e330119feb3c30210670e Mon Sep 17 00:00:00 2001 From: Issac Trotts <15530+ijt@users.noreply.github.com> Date: Thu, 16 May 2019 11:22:19 -0700 Subject: [PATCH] gitserver: close packed-refs file in quickRevParseHead() (#4026) --- CHANGELOG.md | 48 ++++++++++++++++++++++++++++++++++ cmd/gitserver/server/server.go | 5 ++-- 2 files changed, 51 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f45f5201cd67..25c40fc0fa461 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,54 @@ All notable changes to Sourcegraph are documented in this file. ### Added +### Changed + +- The saved searches UI has changed. There is now a Saved searches page in the user and organizations settings area. A saved search appears in the settings area of the user or organization it is associated with. + +### Removed + +### Fixed + +## 3.4.0 (unreleased) + +### Added + +- When `repositoryPathPattern` is configured, paths from the full long name will redirect to the configured name. Extensions will function with the configured name. `repositoryPathPattern` allows administrators to configure "nice names". For example `sourcegraph.example.com/github.com/foo/bar` can configured to be `sourcegraph.example.com/gh/foo/bar` with `"repositoryPathPattern": "gh/{nameWithOwner}"`. (#462) +- Added topQueries to the GraphQL API. +- Admins can now turn off site alerts for patch version release updates using the `alerts.showPatchUpdates` setting. Alerts will still be shown for major and minor version updates. +- The new `gitolite.exclude` setting in [Gitolite external service config](https://docs.sourcegraph.com/admin/external_service/gitolite#configuration) allows you to exclude specific repositories by their Gitolite name so that they won't be mirrored. Upon upgrading, previously "disabled" repositories will be automatically migrated to this exclusion list. +- The new `aws_codecommit.exclude` setting in [AWS CodeCommit external service config](https://docs.sourcegraph.com/admin/external_service/aws_codecommit#configuration) allows you to exclude specific repositories by their AWS name or ID so that they won't be synced. Upon upgrading, previously "disabled" repositories will be automatically migrated to this exclusion list. +- Added a new, _required_ `aws_codecommit.gitCredentials` setting to the [AWS CodeCommit external service config](https://docs.sourcegraph.com/admin/external_service/aws_codecommit#configuration). These Git credentials are required to create long-lived authenticated clone URLs for AWS CodeCommit repositories. For more information about Git credentials, see the AWS CodeCommit documentation: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_ssh-keys.html#git-credentials-code-commit. For detailed instructions on how to create the credentials in IAM, see this page: https://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-gc.html +- Added support for specifying a URL formatted `gitolite.host` setting in [Gitolite external service config](https://docs.sourcegraph.com/admin/external_service/gitolite#configuration) (e.g. `ssh://git@gitolite.example.org:2222/`), in addition to the already supported SCP like format (e.g `git@gitolite.example.org`) +- Added support for overriding critical, site, and external service configurations via files. Specify `CRITICAL_CONFIG_FILE=critical.json`, `SITE_CONFIG_FILE=site.json`, and/or `EXTSVC_CONFIG_FILE=extsvc.json` on the `frontend` container to do this. + +### Changed + +- Kinds of external services in use are now included in [server pings](https://docs.sourcegraph.com/admin/pings). +- Bitbucket Server: An actual Bitbucket icon is now used for the jump-to-bitbucket action on repository pages instead of the previously generic icon. +- Default config for GitHub, GitHub Enterprise, GitLab, Bitbucket Server, and AWS Code Commit external services has been revised to make it easier for first time admins. + +### Removed + +- Fields related to Repository enablement have been deprecated. Mutations are now NOOPs, and for repositories returned the value is always true for Enabled. The enabled field and mutations will be removed in 3.6. Mutations: `setRepositoryEnabled`, `setAllRepositoriesEnabled`, `updateAllMirrorRepositories`, `deleteRepository`. Query parameters: `repositories.enabled`, `repositories.disabled`. Field: `Repository.enabled`. +- Global saved searches are now deprecated. Any existing global saved searches have been assigned to the Sourcegraph instance's first site admin's user account. +- The `search.savedQueries` configuration option is now deprecated. Existing entries remain in user and org settings for backward compatibility, but are unused as saved searches are now stored in the database. + +### Fixed + +- Fixed a bug where submitting a saved query without selecting the location would fail for non-site admins (#3628). +- Fixed settings editors only having a few pixels height. +- Fixed a bug where browser extension and code review integration usage stats were not being captured on the site-admin Usage Stats page. +- Fixed an issue where in some rare cases PostgreSQL starting up slowly could incorrectly trigger a panic in the `frontend` service. +- Fixed an issue where the management console password would incorrectly reset to a new secure one after a user account was created. +- Fixed a bug where gitserver would leak file descriptors when performing common operations. +- Substantially improved the performance of updating external service configurations on instances with thousands of repositories, going from e.g. several minutes to about a minute for ~20k repositories. +- Fully resolved the search performance regression in v3.2.0, restoring performance of search back to the same levels it was before changes made in v3.2.0. + +## 3.3.7 + +### Added + - The `bitbucketserver.exclude` setting in [Bitbucket Server external service config](https://docs.sourcegraph.com/admin/external_service/bitbucketserver#configuration) additionally allows you to exclude repositories matched by a regular expression (so that they won't be synced). ### Changed diff --git a/cmd/gitserver/server/server.go b/cmd/gitserver/server/server.go index d37aa57d1872b..c7783826aee6d 100644 --- a/cmd/gitserver/server/server.go +++ b/cmd/gitserver/server/server.go @@ -26,7 +26,7 @@ import ( "syscall" "time" - opentracing "github.com/opentracing/opentracing-go" + "github.com/opentracing/opentracing-go" "github.com/opentracing/opentracing-go/ext" otlog "github.com/opentracing/opentracing-go/log" "github.com/pkg/errors" @@ -40,7 +40,7 @@ import ( "github.com/sourcegraph/sourcegraph/pkg/repotrackutil" "github.com/sourcegraph/sourcegraph/pkg/trace" "github.com/sourcegraph/sourcegraph/pkg/vcs/git" - log15 "gopkg.in/inconshreveable/log15.v2" + "gopkg.in/inconshreveable/log15.v2" ) // tempDirName is the name used for the temporary directory under ReposDir. @@ -1309,6 +1309,7 @@ func quickRevParseHead(dir string) (string, error) { if err != nil { return "", err } + defer f.Close() scanner := bufio.NewScanner(f) for scanner.Scan() { fields := bytes.Fields(scanner.Bytes())