Skip to content

updating scripts/genproto.sh#13062

Merged
ptabor merged 1 commit intoetcd-io:mainfrom
nate-double-u:13050-genproto-updates
Jun 2, 2021
Merged

updating scripts/genproto.sh#13062
ptabor merged 1 commit intoetcd-io:mainfrom
nate-double-u:13050-genproto-updates

Conversation

@nate-double-u
Copy link
Copy Markdown
Contributor

@nate-double-u nate-double-u commented May 31, 2021

Changing API-reference generator

fixes #13050
contributes to: #111, #12768

Files generated

Most recent commit:

Previous commits:

/cc @chalin

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

Merging #13062 (0266638) into main (c7cbc6b) will increase coverage by 2.66%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #13062      +/-   ##
==========================================
+ Coverage   63.85%   66.52%   +2.66%     
==========================================
  Files         430      425       -5     
  Lines       33142    33677     +535     
==========================================
+ Hits        21163    22402    +1239     
+ Misses       9942     9342     -600     
+ Partials     2037     1933     -104     
Flag Coverage Δ
all 66.52% <ø> (+2.66%) ⬆️

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

Impacted Files Coverage Δ
raft/quorum/quorum.go 0.00% <0.00%> (-100.00%) ⬇️
raft/tracker/state.go 0.00% <0.00%> (-100.00%) ⬇️
raft/util.go 20.56% <0.00%> (-65.43%) ⬇️
raft/confchange/restore.go 39.53% <0.00%> (-55.82%) ⬇️
raft/raftpb/confchange.go 22.97% <0.00%> (-52.71%) ⬇️
raft/quorum/voteresult_string.go 0.00% <0.00%> (-50.00%) ⬇️
raft/quorum/majority.go 60.75% <0.00%> (-39.25%) ⬇️
client/v3/internal/endpoint/endpoint.go 46.34% <0.00%> (-39.03%) ⬇️
raft/rawnode.go 38.80% <0.00%> (-35.83%) ⬇️
raft/tracker/progress.go 62.50% <0.00%> (-34.73%) ⬇️
... and 178 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c7cbc6b...0266638. Read the comment docs.

@nate-double-u
Copy link
Copy Markdown
Contributor Author

I don't think the test failures are related to the documentation updates.

@ptabor
Copy link
Copy Markdown
Contributor

ptabor commented Jun 1, 2021

I think that the tests fail due to shellcheck not understaning tripple quotes:

FAIL: (code:1):
scripts/genproto.sh:103:20: warning: Did you forget to close this single quoted string? [SC1078]
  % 'shellcheck' '-fgcc' 'build' 'test' 'scripts/build-release.sh' 'scripts/codecov_upload.sh' 'scripts/fix.sh' 'scripts/genproto.sh' 'scripts/install-marker.sh' 'scripts/release_mod.sh' 'scripts/test_lib.sh' 'scripts/update_dep.sh' 'scripts/updatebom.sh' './build.sh' './test.sh'
FAIL: 'run shellcheck -fgcc build test scripts/build-release.sh scripts/codecov_upload.sh scripts/fix.sh scripts/genproto.sh scripts/install-marker.sh scripts/release_mod.sh scripts/test_lib.sh scripts/update_dep.sh scripts/updatebom.sh ./build.sh ./test.sh' checking failed (!=0 return code)
scripts/genproto.sh:103:20: note: Expressions don't expand in single quotes, use double quotes for that. [SC2016]
scripts/genproto.sh:108:1: note: This is actually an end quote, but due to next char it looks suspect. [SC1079]
FAIL: 'shellcheck' failed at Mon May 31 20:05:35 UTC 2021

scripts/genproto.sh:117:20: warning: Did you forget to close this single quoted string? [SC1078]
scripts/genproto.sh:117:20: note: Expressions don't expand in single quotes, use double quotes for that. [SC2016]
scripts/genproto.sh:122:1: note: This is actually an end quote, but due to next char it looks suspect. [SC1079]
Error: Process completed with exit code 255.

Copy link
Copy Markdown
Contributor

@chalin chalin left a comment

Choose a reason for hiding this comment

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

See inline comments, and feedback by @ptabor.

@nate-double-u - have you been able to run this script? I'm getting sed errors under macOS. Maybe this currently only runs under Linux?

@nate-double-u
Copy link
Copy Markdown
Contributor Author

have you been able to run this script?

The files I linked in the description were generated. I admittedly did not run it on multiple platforms though.

@nate-double-u
Copy link
Copy Markdown
Contributor Author

I'm getting sed errors under macOS. Maybe this currently only runs under Linux?

Doing a quick look around, it looks like there may be differences between sed on macOS and on Linux. I haven't tested the unmodified script on macOS, I'll have to test it to see if it has problems as well (or see if it's the additional line I added that's causing the issue)

@nate-double-u
Copy link
Copy Markdown
Contributor Author

I think that the tests fail due to shellcheck not understaning tripple quotes

Thanks @ptabor, I'll take a closer look at that

@nate-double-u
Copy link
Copy Markdown
Contributor Author

Files generated by the most recent commit:

@nate-double-u
Copy link
Copy Markdown
Contributor Author

nate-double-u commented Jun 1, 2021

[edit] I had made a comment about tests, but as of the time of this writing the testing hasn't finished. I'm removing the comment and am waiting for the system to finish.

Copy link
Copy Markdown
Contributor

@chalin chalin left a comment

Choose a reason for hiding this comment

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

Hmm, you probably shouldn't be modifying go.mod and go.sum. (Yeah, I know that's what happens when we get the tools we need to run this script.)

I'm thinking that it makes more sense to have this script reside in the etcd website repo.

Thoughts @ptabor @spzala @gyuho?

@nate-double-u
Copy link
Copy Markdown
Contributor Author

nate-double-u commented Jun 1, 2021

Hmm, you probably shouldn't be modifying go.mod and go.sum. (Yeah, I know that's what happens when we get the tools we need to run this script.)

Ya I just noticed that and have removed those edits.

@nate-double-u nate-double-u force-pushed the 13050-genproto-updates branch from f1785c3 to f223b8b Compare June 1, 2021 19:18
@nate-double-u
Copy link
Copy Markdown
Contributor Author

nate-double-u commented Jun 1, 2021

Rebased to clean up commits.

Latest force push updates .gitignore file, adds env vars, and adds new console output on success:

protodoc is finished.

To publish the API References, copy the following files
  - Documentation/dev-guide/api_reference_v3.md
  - Documentation/dev-guide/api_concurrency_reference_v3.md
to the etcd-io/website repo under the /content/en/docs/next/dev-guide/ folder.
(https://github.com/etcd-io/website/tree/main/content/en/docs/next/dev-guide)

./genproto SUCCESS

Generated files:

@nate-double-u nate-double-u requested a review from ptabor June 1, 2021 19:21
@nate-double-u
Copy link
Copy Markdown
Contributor Author

nate-double-u commented Jun 1, 2021

I'm thinking that it makes more sense to have this script reside in the etcd website repo.

If we don't move it, do we want to consider building a GitHub action or something to build the references and push the files across to the etcd-io/website repo automatically? (I've found systems that automate this sort of thing to be fairly fragile in past, but does have the advantage of not requiring someone to remember to update the files manually).

[edit] we may want to consider something like this even if we do decide to move the script.

run sed -i -e 1,3d ${API_REFERENCE_CONCURRENCY_FILE}

log_success "protodoc is finished."
log_success ""
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.

Maybe:

log_warning "The files has NOT been automatically published on the website."

@chalin
Copy link
Copy Markdown
Contributor

chalin commented Jun 2, 2021

@ptabor - does this need to be ported to https://github.com/etcd-io/etcd/tree/release-3.5?

@ptabor
Copy link
Copy Markdown
Contributor

ptabor commented Jun 2, 2021

@ptabor - does this need to be ported to https://github.com/etcd-io/etcd/tree/release-3.5?

Changing protos (so public wire formats) is rather unexpected during a minor version lifetime, so I don't think there are strong reasons to backport (but also costs are low).

@nate-double-u nate-double-u force-pushed the 13050-genproto-updates branch from f223b8b to 8f6e514 Compare June 2, 2021 17:18
@nate-double-u
Copy link
Copy Markdown
Contributor Author

The last force push updates the output as per @ptabor's suggestion.

protodoc is finished.

The API References have NOT been automatically published to the website.

To publish the API References, copy the following files
  - Documentation/dev-guide/api_reference_v3.md
  - Documentation/dev-guide/api_concurrency_reference_v3.md
to the etcd-io/website repo under the /content/en/docs/next/dev-guide/ folder.
(https://github.com/etcd-io/website/tree/main/content/en/docs/next/dev-guide)

./genproto SUCCESS

Changing API-reference generator

- matching changes mentioned in etcd-io/website#330
- generating page frontmater
- updating .gitignore

Signed-off-by: Nate W <4453979+nate-double-u@users.noreply.github.com>
@nate-double-u nate-double-u force-pushed the 13050-genproto-updates branch from 8f6e514 to 9e4dd4d Compare June 2, 2021 17:29
@nate-double-u
Copy link
Copy Markdown
Contributor Author

The last force-push is a copy edit:

protodoc is finished.

The API references have NOT been automatically published on the website.

To publish the API references, copy the following files
  - Documentation/dev-guide/api_reference_v3.md
  - Documentation/dev-guide/api_concurrency_reference_v3.md
to the etcd-io/website repo under the /content/en/docs/next/dev-guide/ folder.
(https://github.com/etcd-io/website/tree/main/content/en/docs/next/dev-guide)

./genproto SUCCESS

@ptabor ptabor merged commit bd475d8 into etcd-io:main Jun 2, 2021
@nate-double-u nate-double-u deleted the 13050-genproto-updates branch June 2, 2021 18:40
@nate-double-u
Copy link
Copy Markdown
Contributor Author

Thanks for the feedback @ptabor & @chalin!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

scripts/genproto.sh: updates needed

4 participants