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

[TT-7306] Revert allow list to migrated mock response #6946

Merged
merged 3 commits into from
Mar 13, 2025

Conversation

edsonmichaque
Copy link
Contributor

@edsonmichaque edsonmichaque commented Mar 12, 2025

User description

TT-7306
Summary [OAS:migration] Migrate Mock Response from Classic API Definition to OAS API Definition
Type Bug Bug
Status In Dev
Points N/A
Labels QA_Fail

Description

This PR makes sure that allow_list is not removed from migrated mock responses

Related Issue

https://tyktech.atlassian.net/browse/TT-7306

Motivation and Context

How This Has Been Tested

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Refactoring or add test (improvements in base code or adds test coverage to functionality)

Checklist

  • I ensured that the documentation is up to date
  • I explained why this PR updates go.mod in detail with reasoning why it's required
  • I would like a code coverage CI quality gate exception and have explained why

PR Type

  • Enhancement
  • Tests

Description

  • Remove resetting of allow list in OAS operations.

  • Update fixture tests with structured allow and block settings.

  • Add new test cases for block list and classic mock response.


Changes walkthrough 📝

Relevant files
Enhancement
operation.go
Remove nil-reset of allow in operation config.                     

apidef/oas/operation.go

  • Removed resetting allow property to nil.
  • Preserve allow configuration for mock responses.
  • +0/-2     
    Tests
    mock_response.yml
    Update mock response fixtures allow/block configuration. 

    apidef/oas/testdata/fixtures/mock_response.yml

  • Replace allow: with explicit allow block.
  • Add new block list test and update response settings.
  • Enable allow list with enabled flag in fixtures.
  • +96/-4   

    Need help?
  • Type /help how to ... in the comments thread for any questions about PR-Agent usage.
  • Check out the documentation for more information.
  • @buger
    Copy link
    Member

    buger commented Mar 12, 2025

    Let's make that PR title a 💯 shall we? 💪

    Your PR title and story title look slightly different. Just checking in to know if it was intentional!

    Story Title [OAS:migration] Migrate Mock Response from Classic API Definition to OAS API Definition
    PR Title [TT-7306] Revert allow list to migrated mock response

    Check out this guide to learn more about PR best-practices.

    Copy link
    Contributor

    API Changes

    no api changes detected

    Copy link
    Contributor

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
    🧪 PR contains tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    YAML Representation

    Several new entries use <nil> to represent null values. Confirm that <nil> is intentional and parsed correctly by YAML parsers; consider using standard YAML null (i.e., "null") if appropriate.

    block: <nil>
    allow:
      enabled: true
    mockResponse:
    Configuration Consistency

    The configuration for the "allow" and "block" fields varies between sections (some endpoints use a structured object with "enabled", while others are set to <nil>). Verify that these differences are deliberate and consistent with the overall design.

    - desc: "block list - classic"
      source: "classic"
      input:
        version_data:
          versions:
            "":
              extended_paths:
                black_list:
                  - path: "/test"
                    method: ""
                    ignore_case: false
                    disabled: false
                    method_actions:
                      GET:
                        action: "reply"
                        code: 200
                        headers:
                          Content-Type: "application/json"
                        data: '{"message": "success"}'
      output:
        paths:
          /test:
            get:
              operationId: testGET
              responses:
                "200":
                  description: ''
        x-tyk-api-gateway:
          middleware:
            operations:
              testGET:
                allow: <nil>
                block:
                  enabled: true
                mockResponse:
                  enabled: true
                  code: 200
                  body: '{"message": "success"}'
                  headers:
                    - name: Content-Type
                      value: application/json
                ignoreAuthentication:
                  enabled: true
    - desc: "basic mock response - classic"

    Copy link
    Contributor

    PR Code Suggestions ✨

    No code suggestions found for the PR.

    @edsonmichaque edsonmichaque enabled auto-merge (squash) March 13, 2025 10:48
    @edsonmichaque edsonmichaque merged commit dad0e98 into master Mar 13, 2025
    40 of 41 checks passed
    @edsonmichaque edsonmichaque deleted the fix/TT-7306-add-allow-list-to-mock-response branch March 13, 2025 11:04
    @edsonmichaque
    Copy link
    Contributor Author

    /release to release-5.8

    Copy link

    tykbot bot commented Mar 13, 2025

    Working on it! Note that it can take a few minutes.

    Copy link

    tykbot bot commented Mar 13, 2025

    Still working...

    tykbot bot pushed a commit that referenced this pull request Mar 13, 2025
    ### **User description**
    <details open>
    <summary><a href="https://tyktech.atlassian.net/browse/TT-7306"
    title="TT-7306" target="_blank">TT-7306</a></summary>
      <br />
      <table>
        <tr>
          <th>Summary</th>
    <td>[OAS:migration] Migrate Mock Response from Classic API Definition to
    OAS API Definition</td>
        </tr>
        <tr>
          <th>Type</th>
          <td>
    <img alt="Bug"
    src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10303?size=medium"
    />
            Bug
          </td>
        </tr>
        <tr>
          <th>Status</th>
          <td>In Dev</td>
        </tr>
        <tr>
          <th>Points</th>
          <td>N/A</td>
        </tr>
        <tr>
          <th>Labels</th>
    <td><a
    href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20QA_Fail%20ORDER%20BY%20created%20DESC"
    title="QA_Fail">QA_Fail</a></td>
        </tr>
      </table>
    </details>
    <!--
      do not remove this marker as it will break jira-lint's functionality.
      added_by_jira_lint
    -->
    
    ---
    
    <!-- Provide a general summary of your changes in the Title above -->
    
    ## Description
    
    <!-- Describe your changes in detail -->
    
    This PR makes sure that `allow_list` is not removed from migrated mock
    responses
    
    ## Related Issue
    
    <!-- This project only accepts pull requests related to open issues. -->
    <!-- If suggesting a new feature or change, please discuss it in an
    issue first. -->
    <!-- If fixing a bug, there should be an issue describing it with steps
    to reproduce. -->
    <!-- OSS: Please link to the issue here. Tyk: please create/link the
    JIRA ticket. -->
    https://tyktech.atlassian.net/browse/TT-7306
    
    ## Motivation and Context
    
    <!-- Why is this change required? What problem does it solve? -->
    
    ## How This Has Been Tested
    
    <!-- Please describe in detail how you tested your changes -->
    <!-- Include details of your testing environment, and the tests -->
    <!-- you ran to see how your change affects other areas of the code,
    etc. -->
    <!-- This information is helpful for reviewers and QA. -->
    
    ## Screenshots (if appropriate)
    
    ## Types of changes
    
    <!-- What types of changes does your code introduce? Put an `x` in all
    the boxes that apply: -->
    
    - [ ] Bug fix (non-breaking change which fixes an issue)
    - [ ] New feature (non-breaking change which adds functionality)
    - [ ] Breaking change (fix or feature that would cause existing
    functionality to change)
    - [ ] Refactoring or add test (improvements in base code or adds test
    coverage to functionality)
    
    ## Checklist
    
    <!-- Go over all the following points, and put an `x` in all the boxes
    that apply -->
    <!-- If there are no documentation updates required, mark the item as
    checked. -->
    <!-- Raise up any additional concerns not covered by the checklist. -->
    
    - [ ] I ensured that the documentation is up to date
    - [ ] I explained why this PR updates go.mod in detail with reasoning
    why it's required
    - [ ] I would like a code coverage CI quality gate exception and have
    explained why
    
    
    ___
    
    ### **PR Type**
    - Enhancement
    - Tests
    
    
    
    ___
    
    ### **Description**
    - Remove resetting of allow list in OAS operations.
    
    - Update fixture tests with structured allow and block settings.
    
    - Add new test cases for block list and classic mock response.
    
    
    ___
    
    
    
    ### **Changes walkthrough** 📝
    <table><thead><tr><th></th><th align="left">Relevant
    files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table>
    <tr>
      <td>
        <details>
    <summary><strong>operation.go</strong><dd><code>Remove nil-reset of
    allow in operation config.</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
    <hr>
    
    apidef/oas/operation.go
    
    <li>Removed resetting allow property to nil.<br> <li> Preserve allow
    configuration for mock responses.
    
    
    </details>
    
    
      </td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6946/files#diff-6d92d2d5b09a5fa7129609bb7cd0d383d015250ec07062b6a93a83257be51fb5">+0/-2</a>&nbsp;
    &nbsp; &nbsp; </td>
    
    </tr>
    </table></td></tr><tr><td><strong>Tests</strong></td><td><table>
    <tr>
      <td>
        <details>
    <summary><strong>mock_response.yml</strong><dd><code>Update mock
    response fixtures allow/block configuration.</code>&nbsp;
    </dd></summary>
    <hr>
    
    apidef/oas/testdata/fixtures/mock_response.yml
    
    <li>Replace allow: <nil> with explicit allow block.<br> <li> Add new
    block list test and update response settings.<br> <li> Enable allow list
    with enabled flag in fixtures.
    
    
    </details>
    
    
      </td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6946/files#diff-c7c72a9398d68abedf9238cc2a9606521069e13034f921e7a979d859e0559c8d">+96/-4</a>&nbsp;
    &nbsp; </td>
    
    </tr>
    </table></td></tr></tr></tbody></table>
    
    ___
    
    > <details> <summary> Need help?</summary><li>Type <code>/help how to
    ...</code> in the comments thread for any questions about PR-Agent
    usage.</li><li>Check out the <a
    href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a>
    for more information.</li></details>
    
    (cherry picked from commit dad0e98)
    @edsonmichaque
    Copy link
    Contributor Author

    /release to release-5.8.0

    Copy link

    tykbot bot commented Mar 13, 2025

    Working on it! Note that it can take a few minutes.

    tykbot bot pushed a commit that referenced this pull request Mar 13, 2025
    ### **User description**
    <details open>
    <summary><a href="https://tyktech.atlassian.net/browse/TT-7306"
    title="TT-7306" target="_blank">TT-7306</a></summary>
      <br />
      <table>
        <tr>
          <th>Summary</th>
    <td>[OAS:migration] Migrate Mock Response from Classic API Definition to
    OAS API Definition</td>
        </tr>
        <tr>
          <th>Type</th>
          <td>
    <img alt="Bug"
    src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10303?size=medium"
    />
            Bug
          </td>
        </tr>
        <tr>
          <th>Status</th>
          <td>In Dev</td>
        </tr>
        <tr>
          <th>Points</th>
          <td>N/A</td>
        </tr>
        <tr>
          <th>Labels</th>
    <td><a
    href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20QA_Fail%20ORDER%20BY%20created%20DESC"
    title="QA_Fail">QA_Fail</a></td>
        </tr>
      </table>
    </details>
    <!--
      do not remove this marker as it will break jira-lint's functionality.
      added_by_jira_lint
    -->
    
    ---
    
    <!-- Provide a general summary of your changes in the Title above -->
    
    ## Description
    
    <!-- Describe your changes in detail -->
    
    This PR makes sure that `allow_list` is not removed from migrated mock
    responses
    
    ## Related Issue
    
    <!-- This project only accepts pull requests related to open issues. -->
    <!-- If suggesting a new feature or change, please discuss it in an
    issue first. -->
    <!-- If fixing a bug, there should be an issue describing it with steps
    to reproduce. -->
    <!-- OSS: Please link to the issue here. Tyk: please create/link the
    JIRA ticket. -->
    https://tyktech.atlassian.net/browse/TT-7306
    
    ## Motivation and Context
    
    <!-- Why is this change required? What problem does it solve? -->
    
    ## How This Has Been Tested
    
    <!-- Please describe in detail how you tested your changes -->
    <!-- Include details of your testing environment, and the tests -->
    <!-- you ran to see how your change affects other areas of the code,
    etc. -->
    <!-- This information is helpful for reviewers and QA. -->
    
    ## Screenshots (if appropriate)
    
    ## Types of changes
    
    <!-- What types of changes does your code introduce? Put an `x` in all
    the boxes that apply: -->
    
    - [ ] Bug fix (non-breaking change which fixes an issue)
    - [ ] New feature (non-breaking change which adds functionality)
    - [ ] Breaking change (fix or feature that would cause existing
    functionality to change)
    - [ ] Refactoring or add test (improvements in base code or adds test
    coverage to functionality)
    
    ## Checklist
    
    <!-- Go over all the following points, and put an `x` in all the boxes
    that apply -->
    <!-- If there are no documentation updates required, mark the item as
    checked. -->
    <!-- Raise up any additional concerns not covered by the checklist. -->
    
    - [ ] I ensured that the documentation is up to date
    - [ ] I explained why this PR updates go.mod in detail with reasoning
    why it's required
    - [ ] I would like a code coverage CI quality gate exception and have
    explained why
    
    
    ___
    
    ### **PR Type**
    - Enhancement
    - Tests
    
    
    
    ___
    
    ### **Description**
    - Remove resetting of allow list in OAS operations.
    
    - Update fixture tests with structured allow and block settings.
    
    - Add new test cases for block list and classic mock response.
    
    
    ___
    
    
    
    ### **Changes walkthrough** 📝
    <table><thead><tr><th></th><th align="left">Relevant
    files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table>
    <tr>
      <td>
        <details>
    <summary><strong>operation.go</strong><dd><code>Remove nil-reset of
    allow in operation config.</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
    <hr>
    
    apidef/oas/operation.go
    
    <li>Removed resetting allow property to nil.<br> <li> Preserve allow
    configuration for mock responses.
    
    
    </details>
    
    
      </td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6946/files#diff-6d92d2d5b09a5fa7129609bb7cd0d383d015250ec07062b6a93a83257be51fb5">+0/-2</a>&nbsp;
    &nbsp; &nbsp; </td>
    
    </tr>
    </table></td></tr><tr><td><strong>Tests</strong></td><td><table>
    <tr>
      <td>
        <details>
    <summary><strong>mock_response.yml</strong><dd><code>Update mock
    response fixtures allow/block configuration.</code>&nbsp;
    </dd></summary>
    <hr>
    
    apidef/oas/testdata/fixtures/mock_response.yml
    
    <li>Replace allow: <nil> with explicit allow block.<br> <li> Add new
    block list test and update response settings.<br> <li> Enable allow list
    with enabled flag in fixtures.
    
    
    </details>
    
    
      </td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6946/files#diff-c7c72a9398d68abedf9238cc2a9606521069e13034f921e7a979d859e0559c8d">+96/-4</a>&nbsp;
    &nbsp; </td>
    
    </tr>
    </table></td></tr></tr></tbody></table>
    
    ___
    
    > <details> <summary> Need help?</summary><li>Type <code>/help how to
    ...</code> in the comments thread for any questions about PR-Agent
    usage.</li><li>Check out the <a
    href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a>
    for more information.</li></details>
    
    (cherry picked from commit dad0e98)
    Copy link

    tykbot bot commented Mar 13, 2025

    @edsonmichaque Seems like there is conflict and it require manual merge.

    edsonmichaque added a commit that referenced this pull request Mar 13, 2025
    …response (#6946) (#6948)
    
    ### **User description**
    [TT-7306] Revert allow list to migrated mock response (#6946)
    
    ### **User description**
    <details open>
    <summary><a href="https://tyktech.atlassian.net/browse/TT-7306"
    title="TT-7306" target="_blank">TT-7306</a></summary>
      <br />
      <table>
        <tr>
          <th>Summary</th>
    <td>[OAS:migration] Migrate Mock Response from Classic API Definition to
    OAS API Definition</td>
        </tr>
        <tr>
          <th>Type</th>
          <td>
    <img alt="Bug"
    
    src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10303?size=medium"
    />
            Bug
          </td>
        </tr>
        <tr>
          <th>Status</th>
          <td>In Dev</td>
        </tr>
        <tr>
          <th>Points</th>
          <td>N/A</td>
        </tr>
        <tr>
          <th>Labels</th>
    <td><a
    
    href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20QA_Fail%20ORDER%20BY%20created%20DESC"
    title="QA_Fail">QA_Fail</a></td>
        </tr>
      </table>
    </details>
    <!--
      do not remove this marker as it will break jira-lint's functionality.
      added_by_jira_lint
    -->
    
    ---
    
    <!-- Provide a general summary of your changes in the Title above -->
    
    ## Description
    
    <!-- Describe your changes in detail -->
    
    This PR makes sure that `allow_list` is not removed from migrated mock
    responses
    
    ## Related Issue
    
    <!-- This project only accepts pull requests related to open issues. -->
    <!-- If suggesting a new feature or change, please discuss it in an
    issue first. -->
    <!-- If fixing a bug, there should be an issue describing it with steps
    to reproduce. -->
    <!-- OSS: Please link to the issue here. Tyk: please create/link the
    JIRA ticket. -->
    https://tyktech.atlassian.net/browse/TT-7306
    
    ## Motivation and Context
    
    <!-- Why is this change required? What problem does it solve? -->
    
    ## How This Has Been Tested
    
    <!-- Please describe in detail how you tested your changes -->
    <!-- Include details of your testing environment, and the tests -->
    <!-- you ran to see how your change affects other areas of the code,
    etc. -->
    <!-- This information is helpful for reviewers and QA. -->
    
    ## Screenshots (if appropriate)
    
    ## Types of changes
    
    <!-- What types of changes does your code introduce? Put an `x` in all
    the boxes that apply: -->
    
    - [ ] Bug fix (non-breaking change which fixes an issue)
    - [ ] New feature (non-breaking change which adds functionality)
    - [ ] Breaking change (fix or feature that would cause existing
    functionality to change)
    - [ ] Refactoring or add test (improvements in base code or adds test
    coverage to functionality)
    
    ## Checklist
    
    <!-- Go over all the following points, and put an `x` in all the boxes
    that apply -->
    <!-- If there are no documentation updates required, mark the item as
    checked. -->
    <!-- Raise up any additional concerns not covered by the checklist. -->
    
    - [ ] I ensured that the documentation is up to date
    - [ ] I explained why this PR updates go.mod in detail with reasoning
    why it's required
    - [ ] I would like a code coverage CI quality gate exception and have
    explained why
    
    
    ___
    
    ### **PR Type**
    - Enhancement
    - Tests
    
    
    
    ___
    
    ### **Description**
    - Remove resetting of allow list in OAS operations.
    
    - Update fixture tests with structured allow and block settings.
    
    - Add new test cases for block list and classic mock response.
    
    
    ___
    
    
    
    ### **Changes walkthrough** 📝
    <table><thead><tr><th></th><th align="left">Relevant
    
    files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table>
    <tr>
      <td>
        <details>
    <summary><strong>operation.go</strong><dd><code>Remove nil-reset of
    allow in operation config.</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
    <hr>
    
    apidef/oas/operation.go
    
    <li>Removed resetting allow property to nil.<br> <li> Preserve allow
    configuration for mock responses.
    
    
    </details>
    
    
      </td>
    <td><a
    
    href="https://github.com/TykTechnologies/tyk/pull/6946/files#diff-6d92d2d5b09a5fa7129609bb7cd0d383d015250ec07062b6a93a83257be51fb5">+0/-2</a>&nbsp;
    &nbsp; &nbsp; </td>
    
    </tr>
    </table></td></tr><tr><td><strong>Tests</strong></td><td><table>
    <tr>
      <td>
        <details>
    <summary><strong>mock_response.yml</strong><dd><code>Update mock
    response fixtures allow/block configuration.</code>&nbsp;
    </dd></summary>
    <hr>
    
    apidef/oas/testdata/fixtures/mock_response.yml
    
    <li>Replace allow: <nil> with explicit allow block.<br> <li> Add new
    block list test and update response settings.<br> <li> Enable allow list
    with enabled flag in fixtures.
    
    
    </details>
    
    
      </td>
    <td><a
    
    href="https://github.com/TykTechnologies/tyk/pull/6946/files#diff-c7c72a9398d68abedf9238cc2a9606521069e13034f921e7a979d859e0559c8d">+96/-4</a>&nbsp;
    &nbsp; </td>
    
    </tr>
    </table></td></tr></tr></tbody></table>
    
    ___
    
    > <details> <summary> Need help?</summary><li>Type <code>/help how to
    ...</code> in the comments thread for any questions about PR-Agent
    usage.</li><li>Check out the <a
    href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a>
    for more information.</li></details>
    
    [TT-7306]:
    https://tyktech.atlassian.net/browse/TT-7306?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
    
    
    ___
    
    ### **PR Type**
    - Enhancement
    - Tests
    
    
    
    ___
    
    ### **Description**
    - Removed resetting of `allow` in operation configuration.
    
    - Updated fixtures with explicit `allow` and `block` settings.
    
    - Added new test cases for classic mock responses.
    
    
    ___
    
    
    
    ### **Changes walkthrough** 📝
    <table><thead><tr><th></th><th align="left">Relevant
    files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table>
    <tr>
      <td>
        <details>
    <summary><strong>operation.go</strong><dd><code>Remove resetting allow
    field in operation code</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
    <hr>
    
    apidef/oas/operation.go
    
    <li>Removed <code>tykOperation.Allow = nil</code> line.<br> <li>
    Preserves <code>allow</code> configuration for mock responses.
    
    
    </details>
    
    
      </td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6948/files#diff-6d92d2d5b09a5fa7129609bb7cd0d383d015250ec07062b6a93a83257be51fb5">+0/-2</a>&nbsp;
    &nbsp; &nbsp; </td>
    
    </tr>
    </table></td></tr><tr><td><strong>Tests</strong></td><td><table>
    <tr>
      <td>
        <details>
    <summary><strong>mock_response.yml</strong><dd><code>Update mock
    response fixtures allow/block settings</code>&nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp; &nbsp; </dd></summary>
    <hr>
    
    apidef/oas/testdata/fixtures/mock_response.yml
    
    <li>Replaced <code><nil></code> allow with explicit settings.<br> <li>
    Added <code>block</code> configuration for test GET operations.<br> <li>
    Introduced new test cases for classic mock responses.
    
    
    </details>
    
    
      </td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6948/files#diff-c7c72a9398d68abedf9238cc2a9606521069e13034f921e7a979d859e0559c8d">+96/-4</a>&nbsp;
    &nbsp; </td>
    
    </tr>
    </table></td></tr></tr></tbody></table>
    
    ___
    
    > <details> <summary> Need help?</summary><li>Type <code>/help how to
    ...</code> in the comments thread for any questions about PR-Agent
    usage.</li><li>Check out the <a
    href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a>
    for more information.</li></details>
    
    Co-authored-by: Edson Michaque <[email protected]>
    edsonmichaque added a commit that referenced this pull request Mar 13, 2025
    …k response (#6946) (#6949)
    
    ### **User description**
    [TT-7306] Revert allow list to migrated mock response (#6946)
    
    ### **User description**
    <details open>
    <summary><a href="https://tyktech.atlassian.net/browse/TT-7306"
    title="TT-7306" target="_blank">TT-7306</a></summary>
      <br />
      <table>
        <tr>
          <th>Summary</th>
    <td>[OAS:migration] Migrate Mock Response from Classic API Definition to
    OAS API Definition</td>
        </tr>
        <tr>
          <th>Type</th>
          <td>
    <img alt="Bug"
    
    src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10303?size=medium"
    />
            Bug
          </td>
        </tr>
        <tr>
          <th>Status</th>
          <td>In Dev</td>
        </tr>
        <tr>
          <th>Points</th>
          <td>N/A</td>
        </tr>
        <tr>
          <th>Labels</th>
    <td><a
    
    href="https://tyktech.atlassian.net/issues?jql=project%20%3D%20TT%20AND%20labels%20%3D%20QA_Fail%20ORDER%20BY%20created%20DESC"
    title="QA_Fail">QA_Fail</a></td>
        </tr>
      </table>
    </details>
    <!--
      do not remove this marker as it will break jira-lint's functionality.
      added_by_jira_lint
    -->
    
    ---
    
    <!-- Provide a general summary of your changes in the Title above -->
    
    ## Description
    
    <!-- Describe your changes in detail -->
    
    This PR makes sure that `allow_list` is not removed from migrated mock
    responses
    
    ## Related Issue
    
    <!-- This project only accepts pull requests related to open issues. -->
    <!-- If suggesting a new feature or change, please discuss it in an
    issue first. -->
    <!-- If fixing a bug, there should be an issue describing it with steps
    to reproduce. -->
    <!-- OSS: Please link to the issue here. Tyk: please create/link the
    JIRA ticket. -->
    https://tyktech.atlassian.net/browse/TT-7306
    
    ## Motivation and Context
    
    <!-- Why is this change required? What problem does it solve? -->
    
    ## How This Has Been Tested
    
    <!-- Please describe in detail how you tested your changes -->
    <!-- Include details of your testing environment, and the tests -->
    <!-- you ran to see how your change affects other areas of the code,
    etc. -->
    <!-- This information is helpful for reviewers and QA. -->
    
    ## Screenshots (if appropriate)
    
    ## Types of changes
    
    <!-- What types of changes does your code introduce? Put an `x` in all
    the boxes that apply: -->
    
    - [ ] Bug fix (non-breaking change which fixes an issue)
    - [ ] New feature (non-breaking change which adds functionality)
    - [ ] Breaking change (fix or feature that would cause existing
    functionality to change)
    - [ ] Refactoring or add test (improvements in base code or adds test
    coverage to functionality)
    
    ## Checklist
    
    <!-- Go over all the following points, and put an `x` in all the boxes
    that apply -->
    <!-- If there are no documentation updates required, mark the item as
    checked. -->
    <!-- Raise up any additional concerns not covered by the checklist. -->
    
    - [ ] I ensured that the documentation is up to date
    - [ ] I explained why this PR updates go.mod in detail with reasoning
    why it's required
    - [ ] I would like a code coverage CI quality gate exception and have
    explained why
    
    
    ___
    
    ### **PR Type**
    - Enhancement
    - Tests
    
    
    
    ___
    
    ### **Description**
    - Remove resetting of allow list in OAS operations.
    
    - Update fixture tests with structured allow and block settings.
    
    - Add new test cases for block list and classic mock response.
    
    
    ___
    
    
    
    ### **Changes walkthrough** 📝
    <table><thead><tr><th></th><th align="left">Relevant
    
    files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table>
    <tr>
      <td>
        <details>
    <summary><strong>operation.go</strong><dd><code>Remove nil-reset of
    allow in operation config.</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
    <hr>
    
    apidef/oas/operation.go
    
    <li>Removed resetting allow property to nil.<br> <li> Preserve allow
    configuration for mock responses.
    
    
    </details>
    
    
      </td>
    <td><a
    
    href="https://github.com/TykTechnologies/tyk/pull/6946/files#diff-6d92d2d5b09a5fa7129609bb7cd0d383d015250ec07062b6a93a83257be51fb5">+0/-2</a>&nbsp;
    &nbsp; &nbsp; </td>
    
    </tr>
    </table></td></tr><tr><td><strong>Tests</strong></td><td><table>
    <tr>
      <td>
        <details>
    <summary><strong>mock_response.yml</strong><dd><code>Update mock
    response fixtures allow/block configuration.</code>&nbsp;
    </dd></summary>
    <hr>
    
    apidef/oas/testdata/fixtures/mock_response.yml
    
    <li>Replace allow: <nil> with explicit allow block.<br> <li> Add new
    block list test and update response settings.<br> <li> Enable allow list
    with enabled flag in fixtures.
    
    
    </details>
    
    
      </td>
    <td><a
    
    href="https://github.com/TykTechnologies/tyk/pull/6946/files#diff-c7c72a9398d68abedf9238cc2a9606521069e13034f921e7a979d859e0559c8d">+96/-4</a>&nbsp;
    &nbsp; </td>
    
    </tr>
    </table></td></tr></tr></tbody></table>
    
    ___
    
    > <details> <summary> Need help?</summary><li>Type <code>/help how to
    ...</code> in the comments thread for any questions about PR-Agent
    usage.</li><li>Check out the <a
    href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a>
    for more information.</li></details>
    
    [TT-7306]:
    https://tyktech.atlassian.net/browse/TT-7306?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
    
    
    ___
    
    ### **PR Type**
    - Enhancement
    - Tests
    
    
    
    ___
    
    ### **Description**
    - Removed resetting of `allow` field in OAS operations.
    
    - Updated fixture YAML to use explicit `allow` settings and add `block`
    configuration.
    
    - Added new test cases for both block list and basic mock response in
    classic endpoints.
    
    
    ___
    
    
    
    ### **Changes walkthrough** 📝
    <table><thead><tr><th></th><th align="left">Relevant
    files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table>
    <tr>
      <td>
        <details>
    <summary><strong>operation.go`</strong><dd><code>Remove nil reset for
    allow configuration.</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    </dd></summary>
    <hr>
    
    `apidef/oas/operation.go`
    
    <li>Removed line that resets <code>allow</code> to nil.<br> <li> Ensured
    preservation of allow configuration.
    
    
    </details>
    
    
      </td>
      <td><a href=""></a></td>
    
    </tr>
    </table></td></tr><tr><td><strong>Tests</strong></td><td><table>
    <tr>
      <td>
        <details>
    <summary><strong>mock_response.yml`</strong><dd><code>Update fixtures
    with explicit allow and block settings.</code>&nbsp; &nbsp;
    </dd></summary>
    <hr>
    
    `apidef/oas/testdata/fixtures/mock_response.yml`
    
    <li>Replaced <code>allow: <nil></code> with explicit structure.<br> <li>
    Introduced <code>block: <nil></code> where applicable.<br> <li> Added
    new fixture entries for block list and basic mock response.
    
    
    </details>
    
    
      </td>
      <td><a href=""></a></td>
    
    </tr>
    </table></td></tr><tr><td><strong>Additional
    files</strong></td><td><table>
    <tr>
      <td><strong>operation.go</strong></td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6949/files#diff-6d92d2d5b09a5fa7129609bb7cd0d383d015250ec07062b6a93a83257be51fb5">+0/-2</a>&nbsp;
    &nbsp; &nbsp; </td>
    
    </tr>
    
    <tr>
      <td><strong>mock_response.yml</strong></td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6949/files#diff-c7c72a9398d68abedf9238cc2a9606521069e13034f921e7a979d859e0559c8d">+96/-4</a>&nbsp;
    &nbsp; </td>
    
    </tr>
    </table></td></tr></tr></tbody></table>
    
    ___
    
    > <details> <summary> Need help?</summary><li>Type <code>/help how to
    ...</code> in the comments thread for any questions about PR-Agent
    usage.</li><li>Check out the <a
    href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a>
    for more information.</li></details>
    
    Co-authored-by: Edson Michaque <[email protected]>
    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.

    3 participants