Skip to content

Conversation

@jlledom
Copy link
Contributor

@jlledom jlledom commented Apr 10, 2025

What this PR does / why we need it:

In order to update nanoid (#3968) I had to update react-jsonschema-form@1.8.1 to @rjsf/core@5.24.1. This package is used from the Policies screen. We have the policies defined in JSON schema format and this package transforms then into HTML forms. The package includes a validator, which last version is V8, but I had to use the deprecated V6 version because our policies.json was being considered inavalid by V8, check this comment where I explain the issue.

After suggesting some changes to our policies.json, a new version has been released which solves the problem, so we are now free to update to the V8 validator.

Which issue(s) this PR fixes

https://issues.redhat.com/browse/THREESCALE-11725

Verification steps

The policies screen should work normally after the change. You can add and remove policies with the developer tools opened, to verify no errors appears in the console.

In particular, the URL Rewriting policy was impossible to add using the new validator, now you should be able to add it and load it without problems.

@jlledom jlledom self-assigned this Apr 10, 2025
@mayorova
Copy link
Contributor

After suggesting some changes to our policies.json, a new version has been released which solves the problem, so we are now free to update to the V8 validator.

Where was the change applied?... I can't find in in the apicast repo.

Copy link
Contributor

@akostadinov akostadinov left a comment

Choose a reason for hiding this comment

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

This means that we need to run with an updated version of apicast, correct?

This update is nice, just pls merge only after updated version of apicast is in all products we support.

@jlledom
Copy link
Contributor Author

jlledom commented Apr 10, 2025

Where was the change applied?... I can't find in in the apicast repo.

No idea, but @tkan145 confirmed it's live, and I checked and at least https://policies.apicast.io/latest/policies.json (the one we use for SaaS) is valid.

@jlledom
Copy link
Contributor Author

jlledom commented Apr 10, 2025

This means that we need to run with an updated version of apicast, correct?

Not necessarily, just the var APICAST_REGISTRY_URL in porta must point to a valid policies.json

This update is nice, just pls merge only after updated version of apicast is in all products we support.

We don't need to update apicast, just the JSON file. However, I don't know what is the value for APICAST_REGISTRY_URL in RHOAM and on prem. @tkan145 Do you know?

@mayorova
Copy link
Contributor

mayorova commented Apr 10, 2025

Where was the change applied?... I can't find in in the apicast repo.

No idea, but @tkan145 confirmed it's live, and I checked and at least https://policies.apicast.io/latest/policies.json (the one we use for SaaS) is valid.

OK, I've found these PRs in apicast that fix the issue:
3scale/APIcast#1525
3scale/APIcast#1538

But I would like to confirm, @tkan145 , this path is used purely for documentation purposes and the files in it are not in any execution path, right?https://github.com/3scale/APIcast/tree/master/doc/policies_list

I understand that the actual policies JSON, when a /policies request is made to APIcast, all individual policies directories are fetched, and the resulting JSON is built on the fly. Is that correct?

We don't need to update apicast, just the JSON file. However, I don't know what is the value for APICAST_REGISTRY_URL in RHOAM and on prem. @tkan145 Do you know?

I understand that it can be set in the APIManager CR, but is set to http://apicast-staging:8090/policies by default:

@jlledom
Copy link
Contributor Author

jlledom commented Apr 11, 2025

But I would like to confirm, @tkan145 , this path is used purely for documentation purposes and the files in it are not in any execution path, right?https://github.com/3scale/APIcast/tree/master/doc/policies_list

I understand that the actual policies JSON, when a /policies request is made to APIcast, all individual policies directories are fetched, and the resulting JSON is built on the fly. Is that correct?

Not sure you're completely right, but I think you point in the right direction. Maybe this comment can help you: 3scale/APIcast#1530 (comment)

We don't need to update apicast, just the JSON file. However, I don't know what is the value for APICAST_REGISTRY_URL in RHOAM and on prem. @tkan145 Do you know?

I understand that it can be set in the APIManager CR, but is set to http://apicast-staging:8090/policies by default:

OK, in that case I think we can assume there's no problem for on premises because the next release will include the changes for both porta and apicast and will include a fixed policies JSON. I don't know about RHOAM, it also uses regular releases, right?

I'll wait to @akostadinov comments before merging.

@jlledom jlledom merged commit 00d9af5 into 3scale:master Apr 11, 2025
17 of 21 checks passed
@mayorova
Copy link
Contributor

Not sure you're completely right, but I think you point in the right direction. Maybe this comment can help you: 3scale/APIcast#1530 (comment)

I'm actually not sure this is right:

Once we agree on how we want to move forward. I will create a new policies_list/x.x.x/policies.json for the 2.16 release and that will reflect in the admin portal without any code changes on your part. WDYT?

I don't think we query policies_list/x.x.x/policies.json from the admin portal 🤔

@jlledom
Copy link
Contributor Author

jlledom commented Apr 11, 2025

I don't think we query policies_list/x.x.x/policies.json from the admin portal 🤔

Yes, we don't.

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