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

THREESCALE-10894 concat filtered services into a single log #1493

Merged
merged 4 commits into from
Sep 30, 2024

Conversation

MStokluska
Copy link
Contributor

Jira: https://issues.redhat.com/browse/THREESCALE-10894

Verification:

  • Install 3scale and create ProductA, ProductB, ProductC, ProductD
  • Promote products to stage -> prod
  • checkout this branch
  • start development env:
make development
make dependencies
  • Start APIcast with the following:
THREESCALE_DEPLOYMENT_ENV=staging APICAST_LOG_LEVEL=warn APICAST_WORKER=1 APICAST_SERVICES_LIST=<REPLACE WITH: ID OF ProductA, ID OF ProductB> APICAST_CONFIGURATION_LOADER=boot APICAST_CONFIGURATION_CACHE=60 THREESCALE_PORTAL_ENDPOINT=https://<REPLACE WITH: admin access token>@<REPLACE WITH: 3scale-admin.your_domain> ./bin/apicast

When the APIcast boots up, confirm the logs to be:

2024/09/05 10:28:03 [warn] 107000#107000: [lua] configuration.lua:171: filter_services(): Filtered out services: 5, 6
2024/09/05 10:28:03 [warn] 107000#107000: [lua] configuration.lua:171: filter_services(): Filtered out services: -1
2024/09/05 10:28:04 [warn] 107025#107025: *2 [lua] configuration.lua:171: filter_services(): Filtered out services: 5, 6, context: ngx.timer

Fitelered out services should display your ProductC and ProductD IDs

@MStokluska MStokluska requested a review from a team as a code owner September 5, 2024 14:45
Copy link
Contributor

@tkan145 tkan145 left a comment

Choose a reason for hiding this comment

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

Good job on the unittest 👍 , can we also add the integration test?

gateway/src/apicast/configuration.lua Outdated Show resolved Hide resolved
gateway/src/apicast/configuration.lua Outdated Show resolved Hide resolved
@tkan145
Copy link
Contributor

tkan145 commented Sep 13, 2024

And for integration test, t/configuration-loading-from-service-list.t is the file that you should look at

location ~ / {
echo 'yay, api backend';
}
--- pipelined_requests eval
Copy link
Contributor

Choose a reason for hiding this comment

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

Use request instead. You only send one request here, and no need for eval

--- request
GET /?user_key=1

Comment on lines 364 to 372
["GET /?user_key=1"]
--- more_headers eval
["Host: one"]
--- response_body eval
["yay, api backend\n"]
--- error_code eval
[200]
--- error_log eval
[qr/filtering out services: 11, 33, 999/]
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above, remove eval

--- request                        
GET /?user_key=1                   
--- more_headers                   
Host: one                          
--- response_body                  
yay, api backend                   
--- error_code: 200                
--- error_log                      
filtering out services: 11, 33, 999

Choose a reason for hiding this comment

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

@tkan145 Just curious what does the eval keyword do here and why is it not needed?

Copy link
Contributor

@tkan145 tkan145 left a comment

Choose a reason for hiding this comment

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

LGTM,

Once we have all the CI tests passed, we can merge this

@MStokluska MStokluska merged commit a30b29b into 3scale:master Sep 30, 2024
14 checks 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.

3 participants