Skip to content

style: test determinism and doxygen additions to guide.#870

Merged
mattklein123 merged 3 commits intoenvoyproxy:masterfrom
htuch:style-extra
May 2, 2017
Merged

style: test determinism and doxygen additions to guide.#870
mattklein123 merged 3 commits intoenvoyproxy:masterfrom
htuch:style-extra

Conversation

@htuch
Copy link
Copy Markdown
Member

@htuch htuch commented May 1, 2017

  • Document that tests should be deterministic and relevant mocks.

  • Rule against Doxygen in internal docs. I actually don't mind either way, this is a strawman that we can discuss during PR review.

* Document that tests should be deterministic and relevant mocks.

* Rule against Doxygen in internal docs. I actually don't mind either way, this is a strawman that we can discuss during PR review.
@htuch
Copy link
Copy Markdown
Member Author

htuch commented May 1, 2017

@dnoe @mattklein123 feel free to opine on the Doxygen+internal comments point, I actually don't mind that much either way, as long as we have a consistent convention that we document.

STYLE.md Outdated
how to best handle this.
* API-level comments should follow normal Doxygen conventions. Use `@param` to describe
parameters, `@return <return-type>` for return values.
parameters, `@return <return-type>` for return values. Internal comments for
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.

I'll register my mild opposition to this here. It seems if we are going through the work to document internal methods and member variables then we might as well follow the Doxygen style. This is largely an academic point for member variables but for methods doxygen provides a structured way of documenting arguments and return semantics that is just as relevant for private methods. The default Doxygen config can be set up to ignore private docs, but for someone new to the code base being able to run Doxygen with the call graph feature and all private documentation enabled seems a good way to create browsable overview documentation (I've used this in past projects, but admittedly we had more extensive documentation of private data and methods from the beginning).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't have a strong opinion here. I guess I would say that in a perfect world, all methods, etc. would have doxygen comments. Realistically though, it's hard enough to get people doing it for public methods and class comments, and I think in most cases people will just not comment on private methods/members instead of going through the whole doxygen dance. So, giving into the reality of human nature I would tend to agree with @htuch. But happy to get some more opinions.

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.

I don't necessarily think it should be mandatory to have doxygen comments for internal members/methods, just that if you're going to write such a comment it shouldn't be deliberately formatted to be ignored by Doxygen.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It does increase the activation energy to comment by forcing people to document every arg/return. I might want to add a quick:

// foo does bar
int foo(char arg);

comment, I don't necessarily want to add full docs for return/args, but the documentation is better than nothing.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

agreed

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.

I think I'd still prefer that we just relax the requirement for "going full doxygen" for private docs rather than mandating that private member/method have comments that Doxygen must ignore. Even in your example "foo does bar" is a perfectly reasonable comment for Doxygen to pick up as an internal method, extensive return type documentation isn't mandatory. In other words: Suggest but not require that private members/methods have a doxygen style comment, and make no hard mandates about all doxygen metadata being populated.

But, I like documenting things pretty extensively as part of my mental code writing process so that's my bias...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yeah I can't say that I really have a strong opinion what to codify here. I will let the two of you sort it out. :)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

OK. We've agreed that comment style for internal docs doesn't matter, but there should be some thought put into making the comment useful (e.g. talking about constraints on arguments etc.) when they are put there.

@dnoe will own adding proper Doxygen support to the build or stop using Doxygen in his internal comments ;)

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 both of those things...

@dnoe
Copy link
Copy Markdown
Contributor

dnoe commented May 2, 2017

LGTM. Doxygen also supports another C++ style, at least two consecutive lines of comments that begin with ///

If we wanted to switch to that at some point a script could convert existing Doxygen javadoc style (/**) comments. Or process comments in either format, but I like consistency.

I'm planning to push a PR over the next few days with an updated Doxygen file and the changes required to run it in CI.

@mattklein123 mattklein123 merged commit e5aa5e4 into envoyproxy:master May 2, 2017
jpsim pushed a commit that referenced this pull request Nov 28, 2022
`//bazel:envoy_mobile_repositories.bzl::envoy_mobile_repositories()`
Initializes all the `http_archive`, `http_file`, `http_jar` required by envoy mobile

`//bazel:envoy_mobile_swift_bazel_support.bzl::swift_support()`
Initializes the `@rules_foreign_cc//:workspace_definitions.bzl::rules_foreign_cc_dependencies()` and installs `build_bazel_apple_support` _after_ all the upstream envoy initializations

`//bazel:envoy_mobile_dependencies.bzl::envoy_mobile_dependencies()`
Initializes the dependencies from dependent repositories

`//bazel:envoy_mobile_toolchains.bzl::envoy_mobile_toolchains()`
Initializes toolchains required

Signed-off-by: Alan Chiu <achiu@lyft.com>

For an explanation of how to fill out the fields, please see the relevant section
in [PULL_REQUESTS.md](https://github.com/envoyproxy/envoy/blob/master/PULL_REQUESTS.md)

Description: bazel: lift dependencies out of WORKSPACE
Risk Level: low
Testing: CI
Docs Changes: n/a
Release Notes: n/a
[Optional Fixes #Issue]
[Optional Deprecated:]

Signed-off-by: JP Simard <jp@jpsim.com>
jpsim pushed a commit that referenced this pull request Nov 29, 2022
`//bazel:envoy_mobile_repositories.bzl::envoy_mobile_repositories()`
Initializes all the `http_archive`, `http_file`, `http_jar` required by envoy mobile

`//bazel:envoy_mobile_swift_bazel_support.bzl::swift_support()`
Initializes the `@rules_foreign_cc//:workspace_definitions.bzl::rules_foreign_cc_dependencies()` and installs `build_bazel_apple_support` _after_ all the upstream envoy initializations

`//bazel:envoy_mobile_dependencies.bzl::envoy_mobile_dependencies()`
Initializes the dependencies from dependent repositories

`//bazel:envoy_mobile_toolchains.bzl::envoy_mobile_toolchains()`
Initializes toolchains required

Signed-off-by: Alan Chiu <achiu@lyft.com>

For an explanation of how to fill out the fields, please see the relevant section
in [PULL_REQUESTS.md](https://github.com/envoyproxy/envoy/blob/master/PULL_REQUESTS.md)

Description: bazel: lift dependencies out of WORKSPACE
Risk Level: low
Testing: CI
Docs Changes: n/a
Release Notes: n/a
[Optional Fixes #Issue]
[Optional Deprecated:]

Signed-off-by: JP Simard <jp@jpsim.com>
nezdolik pushed a commit to nezdolik/envoy that referenced this pull request May 4, 2024
OSX and windows have issues with memalign. So test against tc_memalign
instead.

This should fix _memalign linker-time part of issue envoyproxy#870.
nezdolik pushed a commit to nezdolik/envoy that referenced this pull request May 4, 2024
Weirdly, some OSX compiler does allow -fsized-deallocation, yet barks
on any attempt to actually use it at compile time (!). So lets detect
this as well in configure and opt out as necessary.

Should fix issue envoyproxy#870.
mathetake pushed a commit that referenced this pull request Mar 3, 2026
**Description**
Support model name overrides for GCP gemini and anthropic.

**Related Issues/PRs (if applicable)**

Fixes #870
Related PR: #687

Signed-off-by: Dan Sun <dsun20@bloomberg.net>
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