Skip to content

Commit

Permalink
Moved to allowlist naming; added contributing naming rule about poten…
Browse files Browse the repository at this point in the history
…tially offensive terminology.

Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
  • Loading branch information
bwplotka committed Jun 9, 2020
1 parent a34c3c8 commit fb018fc
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
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

0 comments on commit fb018fc

Please sign in to comment.