Skip to content

Run go fmt over full go directory with go 1.19#24525

Merged
lostluck merged 2 commits intoapache:masterfrom
damccorm:users/damccorm/go-fmt
Dec 5, 2022
Merged

Run go fmt over full go directory with go 1.19#24525
lostluck merged 2 commits intoapache:masterfrom
damccorm:users/damccorm/go-fmt

Conversation

@damccorm
Copy link
Copy Markdown
Contributor

@damccorm damccorm commented Dec 5, 2022

This unblocks using go 1.19 for the Action unit tests & formatting check.

Fixes #24190


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Choose reviewer(s) and mention them in a comment (R: @username).
  • Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI.

@codecov
Copy link
Copy Markdown

codecov bot commented Dec 5, 2022

Codecov Report

Merging #24525 (ad8aa9c) into master (66db2d8) will decrease coverage by 0.00%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master   #24525      +/-   ##
==========================================
- Coverage   73.38%   73.38%   -0.01%     
==========================================
  Files         719      719              
  Lines       97206    97206              
==========================================
- Hits        71335    71332       -3     
- Misses      24524    24526       +2     
- Partials     1347     1348       +1     
Flag Coverage Δ
go 51.63% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
sdks/go/pkg/beam/core/funcx/fn.go 57.30% <ø> (ø)
sdks/go/pkg/beam/core/funcx/output.go 85.71% <ø> (ø)
sdks/go/pkg/beam/core/funcx/sideinput.go 96.34% <ø> (ø)
sdks/go/pkg/beam/core/funcx/signature.go 56.45% <ø> (ø)
sdks/go/pkg/beam/core/graph/bind.go 67.84% <ø> (ø)
sdks/go/pkg/beam/core/graph/coder/registry.go 92.50% <ø> (ø)
sdks/go/pkg/beam/core/graph/fn.go 84.68% <ø> (ø)
sdks/go/pkg/beam/core/metrics/metrics.go 60.29% <ø> (ø)
sdks/go/pkg/beam/core/runtime/exec/sdf.go 70.84% <ø> (ø)
sdks/go/pkg/beam/core/runtime/xlangx/registry.go 42.46% <ø> (ø)
... and 24 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Comment on lines +714 to +715
// - Beam's default reflection based reflectx.Func shim
// - A Type assertion specialized reflectx.Func shim
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this is a change in behavior from 1.18 -> 1.19. 1.19 won't let you have subindented lists. Importantly, however, the following:

//   * foo
//   * bar
//       * baz

has always rendered as:

  * foo
  * bar
  * baz

in the godoc anyways (indents weren't maintained). I fixed a few of these cases in my second commit in this PR and called them out with comments. I left this one since I don't think the indents add anything.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically the sub indents were describing reflectx.Func and reflectx.FuncNxM respectively, so it was intending to serve a purpose. In this case, I agree that there's no reason to fuss over it since it was already broken.

// - Java
// - Vendored Module: beam-sdks-java-extensions-schemaio-expansion-service
// - Run via Gradle: ./gradlew :sdks:java:extensions:schemaio-expansion-service:runExpansionService
// - Reference Class: org.apache.beam.sdk.io.gcp.bigquery.BigQuerySchemaIOProvider and
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated this so that it renders as:

Java:

  * bullets
  * ...
  * ...

instead of the way it currently renders:

* Java
* bullets
* ...
* ...

Current rendering here - https://pkg.go.dev/github.com/apache/beam/sdks/v2@v2.43.0/go/pkg/beam/io/xlang/bigqueryio#hdr-Setup

// - Vendored Module: beam-sdks-java-io-debezium-expansion-service
// - Run via Gradle: ./gradlew :sdks:java:io:debezium:expansion-service:shadowJar
// java -jar <path-to-debezium-jar> <port>
// - Reference Class: org.apache.beam.io.debezium.DebeziumIO
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated this for the same reason as the previous (bigquery one)

// - Vendored Module: beam-sdks-java-extensions-schemaio-expansion-service
// - Run via Gradle: ./gradlew :sdks:java:extensions:schemaio-expansion-service:build
// java -jar <location_of_jar_file_generated_from_above> <port>
// - Reference Class: org.apache.beam.sdk.io.jdbc.JdbcIO
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as bigquery/debezium

// - Reference Class: org.apache.beam.sdk.io.kafka.KafkaIO
// - Vendored Module: beam-sdks-java-io-expansion-service
// - Run via Gradle: ./gradlew :sdks:java:io:expansion-service:runExpansionService
// - Reference Class: org.apache.beam.sdk.io.kafka.KafkaIO
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as bigquery/debezium/jdbc

// /Users/herohde/go/src/github.com/apache/beam/sdks/go/pkg/beam/runners/beamexec/main.go (skip: 2)
// * /Users/herohde/go/src/github.com/apache/beam/sdks/go/examples/wordcount/wordcount.go (skip: 3)
// /usr/local/go/src/runtime/proc.go (skip: 4) // not always present
// /usr/local/go/src/runtime/asm_amd64.s (skip: 4 or 5)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@damccorm damccorm marked this pull request as ready for review December 5, 2022 15:11
@damccorm
Copy link
Copy Markdown
Contributor Author

damccorm commented Dec 5, 2022

R: @lostluck

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Dec 5, 2022

Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control

Copy link
Copy Markdown
Contributor

@lostluck lostluck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for getting ahead on this!

We can now move the Github action to use 1.19+.

@lostluck lostluck merged commit 33af390 into apache:master Dec 5, 2022
@damccorm damccorm deleted the users/damccorm/go-fmt branch December 5, 2022 18:31
lostluck pushed a commit to lostluck/beam that referenced this pull request Dec 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Task][Go SDK]: Update Github action for Go unit testing to use go 1.19 -> blocked on gofmt changes.

2 participants