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

[improve] Update topic admin interface comment, add topic admin test … #1202

Merged
merged 1 commit into from
Apr 12, 2024

Conversation

geniusjoe
Copy link
Contributor

Motivation

Nowadays there are some interfaces(e.g. Create or Delete) in admin/topic.go file have no comments. It will be a little bit confusing when using them, so we could add some comments refer to the same interfaces in java client sdk.

Modifications

  • Add interfaces comments in pulsaradmin/pkg/admin/topic.go
  • Add some test cases in pulsaradmin/pkg/admin/topic_test.go
  • Enable topicLevelPoliciesEnabled=true in integration-tests/conf/standalone.conf to test topic policies

Verifying this change

  • Make sure that the change passes the CI checks.

Does this pull request potentially affect one of the following parts:

If yes was chosen, please highlight the changes

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API: (yes)
    Add comments in topic admin API.
  • The schema: (no)
  • The default values of configurations: (no)
  • The wire protocol: (no)

@geniusjoe geniusjoe force-pushed the dev/admin-topic-comment branch from 22ba482 to 9c19e44 Compare April 11, 2024 08:14
@geniusjoe geniusjoe force-pushed the dev/admin-topic-comment branch from 9c19e44 to 9059606 Compare April 11, 2024 10:02
@geniusjoe
Copy link
Contributor Author

@BewareMyPower Lint fixed. Cound you please help me to retrigger the CI?

@BewareMyPower
Copy link
Contributor

https://github.com/apache/pulsar-client-go/actions/runs/8644969782/job/23706217224?pr=1202 The lint still failed. You can check the lint locally first via make lint.

@geniusjoe geniusjoe force-pushed the dev/admin-topic-comment branch from 9059606 to 5aaf9cc Compare April 11, 2024 16:32
@geniusjoe
Copy link
Contributor Author

https://github.com/apache/pulsar-client-go/actions/runs/8644969782/job/23706217224?pr=1202 The lint still failed. You can check the lint locally first via make lint.

Ok. I ran docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.51.2 golangci-lint run -v in my local env finally because I ran make lint command encountered some problems. And now my code looks good, so could you help me rerun CI to check again?

~/usr/local/services/dev/pulsar-client-go (dev/admin-topic-comment*) # make lint 
GOBIN=/root/usr/local/services/dev/pulsar-client-go/bin go install github.com/golangci/golangci-lint/cmd/[email protected]
/root/go/pkg/mod/github.com/golangci/[email protected]/internal/cache/cache.go:25:2: //go:build comment without // +build comment
/root/go/pkg/mod/github.com/golangci/[email protected]/internal/renameio/renameio.go:16:2: //go:build comment without // +build comment
/root/go/pkg/mod/github.com/golangci/[email protected]/pkg/config/reader.go:14:2: //go:build comment without // +build comment
/root/go/pkg/mod/github.com/golangci/[email protected]/pkg/golinters/gomodguard.go:6:2: //go:build comment without // +build comment
/root/go/pkg/mod/honnef.co/go/[email protected]/go/ir/builder.go:36:2: //go:build comment without // +build comment
make: *** [bin/golangci-lint] Error 1
~/usr/local/services/dev/pulsar-client-go (dev/admin-topic-comment*) # docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.51.2 golangci-lint run -v
level=info msg="[config_reader] Config search paths: [./ /app / /root]"
level=info msg="[config_reader] Used config file .golangci.yml"
level=info msg="[lintersdb] Active 14 linters: [bodyclose goimports gosimple govet ineffassign lll misspell prealloc revive stylecheck typecheck unconvert unparam unused]"
level=info msg="[loader] Go packages loading at mode 575 (compiled_files|exports_file|name|types_sizes|deps|files|imports) took 46.739577476s"
level=info msg="[runner/filename_unadjuster] Pre-built 0 adjustments in 41.37157ms"
level=info msg="[linters_context/goanalysis] analyzers took 47.920237945s with top 10 stages: buildir: 18.590248886s, the_only_name: 11.989958656s, buildssa: 3.814148069s, goimports: 1.890802038s, unused: 1.368279513s, inspect: 1.315114914s, S1038: 1.13399298s, unconvert: 797.11508ms, misspell: 655.835161ms, printf: 585.129123ms"
level=info msg="[runner/skip_dirs] Skipped 1 issues from dir examples/reader by pattern (^|/)examples($|/)"
level=info msg="[runner/skip_dirs] Skipped 1 issues from dir examples/consumer by pattern (^|/)examples($|/)"
level=info msg="[runner/skip_dirs] Skipped 3 issues from dir examples/producer by pattern (^|/)examples($|/)"
level=info msg="[runner/skip_dirs] Skipped 1 issues from dir examples/consumer-listener by pattern (^|/)examples($|/)"
level=info msg="[runner] Issues before processing: 1047, after processing: 0"
level=info msg="[runner] Processors filtering stat (out/in): exclude-rules: 27/803, skip_dirs: 1041/1047, path_prettifier: 1047/1047, skip_files: 1047/1047, autogenerated_exclude: 803/1041, cgo: 1047/1047, identifier_marker: 803/803, exclude: 803/803, nolint: 0/27, filename_unadjuster: 1047/1047"
level=info msg="[runner] processing took 53.715456ms with stages: exclude-rules: 26.730143ms, identifier_marker: 17.495465ms, autogenerated_exclude: 4.830569ms, nolint: 2.413851ms, path_prettifier: 1.702569ms, skip_dirs: 368.561µs, cgo: 94.035µs, filename_unadjuster: 76.614µs, max_same_issues: 942ns, uniq_by_line: 340ns, source_code: 300ns, path_shortener: 292ns, exclude: 281ns, sort_results: 271ns, severity-rules: 261ns, diff: 251ns, skip_files: 240ns, max_from_linter: 231ns, max_per_file_from_linter: 130ns, path_prefixer: 110ns"
level=info msg="[runner] linters took 6.198483896s with stages: goanalysis_metalinter: 6.144668716s"
level=info msg="File cache stats: 274 entries of total size 1.9MiB"
level=info msg="Memory: 528 samples, avg is 106.1MB, max is 1016.6MB"
level=info msg="Execution took 52.984613367s"

@BewareMyPower
Copy link
Contributor

BewareMyPower commented Apr 12, 2024

Ok. I ran docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.51.2 golangci-lint run -v in my local env

The golangci-lint version is now 1.56.2, while your command uses 1.51.2. That makes the difference.

@BewareMyPower BewareMyPower merged commit 1081973 into apache:master Apr 12, 2024
8 checks passed
@RobertIndie RobertIndie added this to the v0.13.0 milestone Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants