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

feat(guidelines): add guidelines for test header usage in rest apis #65

Merged
merged 20 commits into from
Sep 18, 2024

Conversation

maxedenharter0507
Copy link
Contributor

@maxedenharter0507 maxedenharter0507 commented Apr 8, 2024

We identified that there is no rule about flagging test requests or responses of REST APIs. As we have a guideline for async events the new rules following the same approach.

Open questions in my mind to be discussed:

  • Is it a good idea to use a header for responses?
  • What about responses of collection APIs?

Changelog:

New

@BirgitBader BirgitBader requested a review from cgebken April 10, 2024 06:48
maxedenharter0507 and others added 7 commits June 17, 2024 13:49
Co-authored-by: Christina Framke <christina.gebken@otto.de>
…r.md

Co-authored-by: Christina Framke <christina.gebken@otto.de>
…r.md

Co-authored-by: Christina Framke <christina.gebken@otto.de>
Co-authored-by: Christina Framke <christina.gebken@otto.de>
Co-authored-by: Christina Framke <christina.gebken@otto.de>
Co-authored-by: Christina Framke <christina.gebken@otto.de>
Co-authored-by: Christina Framke <christina.gebken@otto.de>
Copy link
Contributor

@cgebken cgebken left a comment

Choose a reason for hiding this comment

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

One last suggestion.. Sorry :D

…r.md

Co-authored-by: Christina Framke <christina.gebken@otto.de>
Copy link
Contributor

@cgebken cgebken left a comment

Choose a reason for hiding this comment

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

As I'd like to support you with this PR, let me "request" these last change as I ran the script to find new available rule IDs.

According changelog suggestion:

Changelog:

### New

- MAY use Test header [R000080](../api-guidelines/rest/http/headers/rules/may-use-test-header.md)
- MUST forward Test header [R000081](../api-guidelines/rest/http/headers/rules/must-forward-test-header.md)

maxedenharter0507 and others added 2 commits June 25, 2024 16:25
Co-authored-by: Christina Framke <christina.gebken@otto.de>
…r.md

Co-authored-by: Christina Framke <christina.gebken@otto.de>
@maxedenharter0507
Copy link
Contributor Author

As I'd like to support you with this PR, let me "request" these last change as I ran the script to find new available rule IDs.

According changelog suggestion:

Changelog:

### New

- MAY use Test header [R000080](../api-guidelines/rest/http/headers/rules/may-use-test-header.md)
- MUST forward Test header [R000081](../api-guidelines/rest/http/headers/rules/must-forward-test-header.md)

Done

@BirgitBader
Copy link
Contributor

Can you take a look at this PR, @thomasklinger1234 @jensfischer1515, thx :)

Copy link

@ccudennec-otto ccudennec-otto left a comment

Choose a reason for hiding this comment

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

I read the new guideline and find it helpful.

I see additional need for communication between all involved teams if they need to differentiate processing "test" requests and regular requests. I guess there's not automatic way to do that. Should we stress this fact even more?

@maxedenharter0507
Copy link
Contributor Author

I read the new guideline and find it helpful.

I see additional need for communication between all involved teams if they need to differentiate processing "test" requests and regular requests. I guess there's not automatic way to do that. Should we stress this fact even more?

Hey @ccudennec-otto, do you mean communication after introducing this rule, e.g. in our TD circle? Or do mean we should add more clarification in the description of the rule itself?

@ccudennec-otto
Copy link

Hi @maxedenharter0507 !

API consumers and providers may use the OTTO-specific Test header described within this rule to communicate that a request or response is part of a test.

Test requests are created in various contexts.
Some of them require special handling on provider or consumer side, such as bypassing specific validations or using > modified business logic while processing.
This rule defines the test header that API consumers and providers can use to identify test data.
Downstream teams can then forward this test header in subsequent processing steps, e.g. as a test extension in an asynchronous event.

I just wondered what happens if a team uses "Test" headers but consuming team don't consider them. As the header is not restricted to nonlive environments, it could trigger some real-world actions, couldn't it? Maybe those actions even cost real money. That's the potential risk that I see and that's why I thought we could stress this a little more.

I'm available for a chat or call - maybe it makes it easier to clarify this issue for me. 🙂

maxedenharter0507 and others added 4 commits September 17, 2024 10:16
Co-authored-by: Birgit Bader <birgit.bader@otto.de>
Co-authored-by: Birgit Bader <birgit.bader@otto.de>
Co-authored-by: Birgit Bader <birgit.bader@otto.de>
Co-authored-by: Birgit Bader <birgit.bader@otto.de>
@BirgitBader BirgitBader changed the title feat(guidelines): Add guidelines for test header usage in REST APIs feat(guidelines): add guidelines for test header usage in rest apis Sep 18, 2024
@BirgitBader BirgitBader merged commit f11b057 into otto-de:main Sep 18, 2024
1 check passed
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.

5 participants