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

Also support "preview" features, in addition to "experimental" features #2960

Merged
merged 13 commits into from
May 2, 2023

Conversation

abernix
Copy link
Member

@abernix abernix commented Apr 17, 2023

This expands on the existing mechanism that was originally introduced in #2242, which supports the notion of an "experimental" feature, and make it compatible with the notion of "preview" features.

Most of this code was written by @o0Ignition0o, I just extracted it and put it here! 😄

Checklist

Complete the checklist (and note appropriate exceptions) before a final PR is raised.

  • Changes are compatible[^1]
  • [-] Documentation[^2] completed
  • [-] Performance impact assessed and acceptable
  • Tests added and passing[^3]
    • [-] Unit Tests
    • [-] Integration Tests
    • Manual Tests

@github-actions

This comment has been minimized.

@@ -691,13 +691,13 @@ mod tests {
{
query: Query
}

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure why all this whitespace changed within this PR!

@abernix abernix marked this pull request as ready for review April 17, 2023 12:34
Comment on lines +5 to +7
"experimental_logging": "https://github.com/apollographql/router/discussions/1961"
},
"preview": {}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggest adding a test gated experimental and preview dummy features for testing.
This would mean that tests dont need to change once experimental logging becomes non-experimental and would also allow unit test testing of preview code path.

Copy link
Contributor

Choose a reason for hiding this comment

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

Do you mean gated on #[cfg(test)]?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes

Copy link
Contributor

Choose a reason for hiding this comment

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

I think proper tests for this feature would need to be lifecycle tests in order to capture stdout. But those use $CARGO_BIN_EXE_router, the "normal" executable which is compiled without cfg(test).

Do we still want experimental_noop and preview_noop configs for testing, if they are user-visible?

.collect();
if !needed_discussions.is_empty() {
tracing::info!(
r#"You're using some "preview" features of the Apollo Router (those which have their configuration prefixed by "preview"). These features are not officially supported with any SLA and may still contain bugs or undergo iteration. You're encouraged to try preview features in test environments to familiarize yourself with upcoming functionality before it reaches general availability. For more information about launch stages, please see the documentation here: https://www.apollographql.com/docs/resources/product-launch-stages/"#,
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this message include which preview features are used, like the corresponding message does for experimental features?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm glad you caught that, too. I was also wondering that, but I cherry picked this off another branch. I meant to either:

  1. Check it out and try out how it behaved in practice.
  2. Write a test that snapshotted it.

At this moment, I'm not sure when I'll be able to get back to this PR though, but this point of uncertainty still stands right now.

let needed_discussions: Vec<String> = used_preview_conf
.into_iter()
.filter_map(|used_conf| {
self.experimental
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be self.preview. I’m fixing this and refactoring to share common code.

@SimonSapin
Copy link
Contributor

I’ve rebased to fix a merge conflict but kept my commits separate for now. These can be squashed after review. They refactor the code a bit, add tests, and add a changelog entry. Please review!

@SimonSapin SimonSapin enabled auto-merge (squash) May 2, 2023 13:51
@SimonSapin SimonSapin merged commit 44f9a26 into dev May 2, 2023
@SimonSapin SimonSapin deleted the abernix/preview_features branch May 2, 2023 14:48
@abernix abernix mentioned this pull request May 3, 2023
garypen pushed a commit that referenced this pull request May 10, 2023
…es (#2960)

This expands on the existing mechanism that was originally introduced in
#2242, which supports the
notion of an "experimental" feature, and make it compatible with the
notion of "preview" features.

**Checklist**

Complete the checklist (and note appropriate exceptions) before a final
PR is raised.

- [x] Changes are compatible[^1]
- [x] Documentation[^2] completed
- [-] Performance impact assessed and acceptable
- Tests added and passing[^3]
    - [-] Unit Tests
    - [x] Integration Tests
    - [x] Manual Tests

---------

Co-authored-by: o0Ignition0o <jeremy.lempereur@gmail.com>
Co-authored-by: Simon Sapin <simon@apollographql.com>
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.

6 participants