Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved to allowlist naming; added contributing naming rule about potentially offensive terminology. #2739

Merged
merged 1 commit into from
Jun 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ We use *breaking* word for marking changes that are not backward compatible (rel
- [2603](https://github.com/thanos-io/thanos/pull/2603) Store/Querier: Significantly optimize cases where StoreAPIs or blocks returns exact overlapping chunks (e.g Store GW and sidecar or brute force Store Gateway HA).
- [#2671](https://github.com/thanos-io/thanos/pull/2671) *breaking* Tools: bucket replicate flag `--resolution` is now in Go duration format.
- [#2671](https://github.com/thanos-io/thanos/pull/2671) Tools: bucket replicate now replicates by default all blocks.

- [#2739](https://github.com/thanos-io/thanos/pull/2739) Changed `bucket tool bucket verify` `--id-whitelist` flag to `--id`.

### Added

Expand Down
8 changes: 8 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ method with the owners of this repository before making a change.

Adding a large new feature or/and component to Thanos should be done by first creating a [proposal](docs/proposals) document outlining the design decisions of the change, motivations for the change, and any alternatives that might have been considered.

## General Naming

In the code and documentation prefer non-offensive terminology, for example:

* `allowlist` / `denylist` (instead of `whitelist` / `blacklist`)
* `primary` / `replica` (instead of `master` / `slave`)
* `openbox` / `closedbox` (instead of `whitebox` / `blackbox`)

## Components Naming

Thanos is a distributed system composed with several services and CLI tools as listed [here](cmd/thanos).
Expand Down
14 changes: 7 additions & 7 deletions cmd/thanos/tools_bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func registerBucketVerify(m map[string]setupFunc, root *kingpin.CmdClause, name
Short('r').Default("false").Bool()
issuesToVerify := cmd.Flag("issues", fmt.Sprintf("Issues to verify (and optionally repair). Possible values: %v", allIssues())).
Short('i').Default(verifier.IndexIssueID, verifier.OverlappedBlocksIssueID).Strings()
idWhitelist := cmd.Flag("id-whitelist", "Block IDs to verify (and optionally repair) only. "+
ids := cmd.Flag("id", "Block IDs to verify (and optionally repair) only. "+
"If none is specified, all blocks will be verified. Repeated field").Strings()
deleteDelay := modelDuration(cmd.Flag("delete-delay", "Duration after which blocks marked for deletion would be deleted permanently from source bucket by compactor component. "+
"If delete-delay is non zero, blocks will be marked for deletion and compactor component is required to delete blocks from source bucket. "+
Expand Down Expand Up @@ -153,18 +153,18 @@ func registerBucketVerify(m map[string]setupFunc, root *kingpin.CmdClause, name
}

var idMatcher func(ulid.ULID) bool = nil
if len(*idWhitelist) > 0 {
whilelistIDs := map[string]struct{}{}
for _, bid := range *idWhitelist {
if len(*ids) > 0 {
idsMap := map[string]struct{}{}
for _, bid := range *ids {
id, err := ulid.Parse(bid)
if err != nil {
return errors.Wrap(err, "invalid ULID found in --id-whitelist flag")
return errors.Wrap(err, "invalid ULID found in --id-allowlist flag")
}
whilelistIDs[id.String()] = struct{}{}
idsMap[id.String()] = struct{}{}
}

idMatcher = func(id ulid.ULID) bool {
if _, ok := whilelistIDs[id.String()]; !ok {
if _, ok := idsMap[id.String()]; !ok {
return false
}
return true
Expand Down
3 changes: 1 addition & 2 deletions docs/components/tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,7 @@ Flags:
Issues to verify (and optionally repair). Possible
values: [duplicated_compaction index_issue
overlapped_blocks]
--id-whitelist=ID-WHITELIST ...
Block IDs to verify (and optionally repair) only. If
--id=ID ... Block IDs to verify (and optionally repair) only. If
none is specified, all blocks will be verified.
Repeated field
--delete-delay=0s Duration after which blocks marked for deletion would
Expand Down