Skip to content

Commit

Permalink
Merge pull request #11 from privacysandbox/release-0.2
Browse files Browse the repository at this point in the history
Release 0.2.0 (#10)
  • Loading branch information
peiwenhu committed Sep 14, 2022
2 parents 4430e59 + 91b9996 commit cbdecc7
Show file tree
Hide file tree
Showing 152 changed files with 2,772 additions and 1,515 deletions.
4 changes: 4 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ build --client_env=CC=clang
build --cxxopt=-std=c++17
build --copt=-Werror=return-type
build --copt=-Werror=unused-result
build -c opt
build --color=yes

test --test_output=errors
1 change: 0 additions & 1 deletion .bazelversion

This file was deleted.

1 change: 1 addition & 0 deletions .bazelversion
9 changes: 9 additions & 0 deletions .markdownlint-cli2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ config:
#stern: true
code_blocks: false

# these are apparently in conflict with prettier's markdown formatting
list-marker-space: false
list-indent: false
ul-indent: false

headings: false

proper-names:
Expand All @@ -18,3 +23,7 @@ config:
- Node.js

fix: true

ignores:
- CHANGELOG.md
- google_internal/LATEST_RELEASE.md
83 changes: 71 additions & 12 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@

# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
exclude: ^bazel-.*$
exclude: (?x)^(
bazel-(bin|out|testlogs|workspace)/.*|
.bazel_output/.*|
version.txt
)$

fail_fast: true
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand All @@ -23,13 +28,25 @@ repos:
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: mixed-line-ending
- id: detect-private-key
- id: trailing-whitespace
- id: check-case-conflict
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
- id: check-json
- id: check-symlinks
- id: check-added-large-files
- id: check-vcs-permalinks
- id: check-executables-have-shebangs
- id: detect-private-key

- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 3.0.0
hooks:
- id: git-check
- id: script-must-not-have-extension
exclude: '^google_internal/.*/kokoro_(presubmit|continuous).sh$'
- id: script-must-have-extension
- id: require-ascii

- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v14.0.6
Expand All @@ -41,34 +58,42 @@ repos:

- repo: local
hooks:
- id: addlicense-check
name: addlicense check
- id: addlicense
name: addlicense
language: golang
additional_dependencies:
- github.com/google/addlicense@v1.0.0
always_run: true
always_run: false
pass_filenames: true
entry: addlicense -check
entry: addlicense -v
types_or:
- c++
- c
- terraform

- id: addlicense
name: addlicense
- id: addlicense-check
name: addlicense check
language: golang
additional_dependencies:
- github.com/google/addlicense@v1.0.0
always_run: true
always_run: false
pass_filenames: true
entry: addlicense -v
entry: addlicense -check
types_or:
- c++
- c
- terraform

- id: terraform-fmt
name: terraform fmt
language: script
pass_filenames: false
entry: tools/terraform fmt -write=true -recursive
types_or:
- terraform

- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.0.0-alpha.0" # Use the sha or tag you want to point at
rev: v2.7.1
hooks:
- id: prettier
name: prettier markdown
Expand All @@ -81,3 +106,37 @@ repos:
- id: markdownlint-cli2
name: lint markdown

- repo: local
hooks:
- id: buildifier
name: buildifier
description: Format bazel WORKSPACE, BUILD and .bzl files with a standard convention.
language: golang
additional_dependencies:
- github.com/bazelbuild/buildtools/buildifier@5.1.0
always_run: true
pass_filenames: true
types_or:
- bazel
entry: buildifier
args:
- -lint=fix
- -mode=fix
- -warnings=all

- repo: https://github.com/cpplint/cpplint
rev: 1.6.1
hooks:
- id: cpplint
types_or:
- c++
- c
args:
- --filter=-build/c++11,+build/c++17,-build/header_guard,-build/include_order,+build/include_what_you_use,-build/include_subdir,-readability/casting,-readability/todo,-runtime/references
- --quiet

- repo: https://github.com/psf/black
rev: 22.8.0
hooks:
- id: black
name: black python formatter
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/.git/
/CHANGELOG.md
/google_internal/LATEST_RELEASE.md
2 changes: 1 addition & 1 deletion .versionrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
{"type": "fix", "section": "Bug Fixes"},
{"type": "build", "section": "Build System"},
{"type": "docs", "section": "Documentation"},
{"type": "internal", "hidden": true},
{"type": "chore", "hidden": true},
{"type": "test", "hidden": true},
{"type": "refactor", "hidden": true}
Expand All @@ -24,4 +25,3 @@
}
]
}

77 changes: 24 additions & 53 deletions BUILD
Original file line number Diff line number Diff line change
@@ -1,26 +1,8 @@
package(default_visibility = ["//:__subpackages__"])

load("@com_github_bazelbuild_buildtools//buildifier:def.bzl", "buildifier", "buildifier_test")
load("@bazel_skylib//rules:common_settings.bzl", "string_flag")
load("@pip_deps//:requirements.bzl", "requirement")
load("@rules_python//python:defs.bzl", "py_binary")

buildifier(
name = "buildifier",
)
load("@bazel_tools//tools/python:toolchain.bzl", "py_runtime_pair")
load("@rules_python//python:defs.bzl", "py_runtime")

buildifier_test(
name = "buildifier_test",
srcs = glob(
[
"*.BUILD",
"*.bzl",
"BUILD",
"WORKSPACE",
],
),
verbose = True,
)
package(default_visibility = ["//:__subpackages__"])

# Config settings to determine which platform the system will be built to run on
# Example:
Expand Down Expand Up @@ -79,44 +61,34 @@ exports_files(
[".bazelversion"],
)

py_binary(
name = "pre-commit",
srcs = [
requirement("pre-commit"),
],
args = [
"run",
"--config",
"$(location .pre-commit-config.yaml)",
"--all-files",
],
data = [".pre-commit-config.yaml"],
main = "main.py",
deps = [
requirement("pre-commit"),
],
# define the python3 runtime.
# this path must exist in the bazel build environment ie. the build container images must install python3.8 in this path
PY3_PATH = "/usr/bin/python3.8"

py_runtime(
name = "py_runtime",
interpreter_path = PY3_PATH,
python_version = "PY3",
visibility = ["//visibility:public"],
)

py_binary(
name = "pre-commit-autoupdate",
srcs = [
requirement("pre-commit"),
],
args = [
"autoupdate",
],
main = "main.py",
deps = [
requirement("pre-commit"),
],
py_runtime_pair(
name = "py_runtime_pair",
py2_runtime = None,
py3_runtime = ":py_runtime",
)

toolchain(
name = "py_toolchain",
toolchain = ":py_runtime_pair",
toolchain_type = "@bazel_tools//tools/python:toolchain_type",
)

genrule(
name = "update-deps",
outs = ["update_deps.bin"],
cmd = """cat << EOF > '$@'
bazel run //third_party/py_requirements:base.update
bazel run //:pre-commit-autoupdate
tools/pre-commit autoupdate
EOF""",
executable = True,
local = True,
Expand All @@ -126,8 +98,7 @@ genrule(
name = "precommit-hooks",
outs = ["run_precommit_hooks.bin"],
cmd = """cat << EOF > '$@'
bazel run //:buildifier
bazel run //:pre-commit
tools/pre-commit
EOF""",
executable = True,
local = True,
Expand Down
53 changes: 53 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,59 @@

All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.

## [0.2.0](https://github.com/privacysandbox/fledge-key-value-service/compare/release-0.1.0...release-0.2.0) (2022-09-07)


### Features

* Add arg processing to cbuild script (b45ca62)
* Add bazel-debian helper script (c0b38b4)
* Add black python formatter to pre-commit (6d079d9)
* Add optional flags to cbuild tool (6b68d11)
* Inject clang-version as a bazel action_env (40af734)
* Migrate generation of builders/release container image to Dockerfile (abb70a8)
* Remove python build dependencies from bazel (81dcb7a)
* Support installation of git pre-commit hook (b7c565a)
* Support running the server container locally (8370503)
* Use EC2 instance connect for ssh access. (604e3b5)


### Bug Fixes

* Add public/ to presubmit tests (2d0056a)
* Add python version to action_env (8e0e074)
* Add require-ascii pre-commit hook (50eb751)
* Add/remove basic pre-commit hooks (f8e46cd)
* Allow for short(er) presubmit builds (8656da5)
* Change ownership of dist/ to user (d7282a2)
* Correct git instructions at the end of cut_release (76c19de)
* Define python3 toolchain (fa83525)
* Ensure /etc/gitconfig is readable by all (f0c82c2)
* Install bazel version as specified in .bazelversion (00d6f63)
* Move bazel env vars from comments to help text (32b2f6f)
* Pin version of bazelisk (face7df)
* Pin version of libc++-dev (08b8d7a)
* Pin version of python3.8 (ad9c61f)
* Remove check for uncommitted changes, tools/pre-commit exit status should suffice (b96636c)
* Tidy cut_release (51f1b0a)
* Upgrade zstd to v1.5.2 (ba7bda1)


### Build System

* Add buildifier tool to pre-commit (1904652)
* Add terraform fmt to pre-commit (0ba7623)
* Add terraform to tools (96ef5ee)
* Add tools/pre-commit (6083417)
* Adjust branch specification for mirroring to GitHub (a004730)
* Move commit-and-tag-version into tools dir (73e0c42)
* Move gh into tools dir (d6a15c1)
* Reduce redundant installation commands (59b93c8)
* Reinstate use of cpplint, via pre-commit tool (be0b5e5)
* Remove buildifier from bazel build as it is redundant with pre-commit (db6b139)
* Remove release-please tool (6bcd54a)
* Rename builders/bazel to build-debian (71b81b0)

### 0.1.0 (2022-08-18)


Expand Down
6 changes: 0 additions & 6 deletions CPPLINT.cfg

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -199,4 +199,4 @@
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
Loading

0 comments on commit cbdecc7

Please sign in to comment.