Skip to content

feat: Adds IMSI QoS endpoint replacing DNN QoS from PolicyControl#73

Merged
gab-arrobo merged 10 commits intoomec-project:mainfrom
Gmerold:add-qos-endpoint
Jul 15, 2025
Merged

feat: Adds IMSI QoS endpoint replacing DNN QoS from PolicyControl#73
gab-arrobo merged 10 commits intoomec-project:mainfrom
Gmerold:add-qos-endpoint

Conversation

@Gmerold
Copy link
Copy Markdown
Contributor

@Gmerold Gmerold commented Jul 8, 2025

This PR implements latest update to the new NF configuration system.

To acknowledge the fact that subscribers using the same DNN can be served with different QoS, new endpoint is introduced. The /nfconfig/qos/{dnn}/{imsi} endpoint allows getting the QoS configuration for a given IMSI.

Signed-off-by: Bartlomiej Gmerek <bartlomiej.gmerek@canonical.com>
@Gmerold Gmerold force-pushed the add-qos-endpoint branch from 2bf06f3 to 371882c Compare July 8, 2025 12:19
@gab-arrobo gab-arrobo requested a review from Copilot July 8, 2025 14:43
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds an IMSI-specific QoS endpoint replacing DNN-level QoS in the NF configuration API.

  • Introduces new /nfconfig/qos/{dnn}/{imsi} path and ImsiQos schema in the OpenAPI spec.
  • Removes the old DnnQos model and related references in PolicyControl.
  • Implements client-side Go support for the new endpoint in api_default.go.

Reviewed Changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 1 comment.

File Description
nfConfigApi/webconsole-api.yaml Added new QoS path with ImsiQos schema, removed DnnQos usage.
nfConfigApi/model_*.go Added compile-time MappedNullable checks across models and dropped DnnQos refs.
nfConfigApi/model_imsi_qos.go Introduced generated ImsiQos model with JSON marshalling and validation.
nfConfigApi/api_default.go Implemented NfconfigQosDnnImsiGet client methods using the new endpoint.
Comments suppressed due to low confidence (2)

nfConfigApi/webconsole-api.yaml:116

  • Add a pattern field to the imsi parameter schema to enforce the expected format, e.g. ^imsi-\\d{15,16}$.
          description: IMSI in format “imsi-” followed by 15 or 16 digits

nfConfigApi/api_default.go:422

  • Add unit tests for the new NfconfigQosDnnImsiGet client method to cover success, not-found, and error scenarios.
type ApiNfconfigQosDnnImsiGetRequest struct {

Signed-off-by: Bartlomiej Gmerek <bartlomiej.gmerek@canonical.com>
Copy link
Copy Markdown
Contributor

@gab-arrobo gab-arrobo left a comment

Choose a reason for hiding this comment

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

Overall, it looks good. I added some minor comments.
BTW, if you need to create a release (i.e., tag), you need to modify the VERSION file

@Gmerold
Copy link
Copy Markdown
Contributor Author

Gmerold commented Jul 10, 2025

Overall, it looks good. I added some minor comments. BTW, if you need to create a release (i.e., tag), you need to modify the VERSION file

Hello @gab-arrobo,
While I agree with your comments, all of the code in question has been auto generated by the openapi-generator. If I start changing the generated code, it will cause conflicts/changes every time we run the generator. Then we'll have to manually inspect every file to see what was changed and why and potentially revert the change manually.

Alternatively (for the consts specifically) I could update the enums in the webconsole-api.yaml, i.e.

Direction:
      type: string
      enum:
        - DIRECTION-DOWNLINK
        - DIRECTION-UPLINK
        - DIRECTION-BIDIRECTIONAL
        - DIRECTION-UNSPECIFIED

What do you think about that?

@patriciareinoso
Copy link
Copy Markdown

Overall, it looks good. I added some minor comments. BTW, if you need to create a release (i.e., tag), you need to modify the VERSION file

Hello @gab-arrobo, While I agree with your comments, all of the code in question has been auto generated by the openapi-generator. If I start changing the generated code, it will cause conflicts/changes every time we run the generator. Then we'll have to manually inspect every file to see what was changed and why and potentially revert the change manually.

Alternatively (for the consts specifically) I could update the enums in the webconsole-api.yaml, i.e.

Direction:
      type: string
      enum:
        - DIRECTION-DOWNLINK
        - DIRECTION-UPLINK
        - DIRECTION-BIDIRECTIONAL
        - DIRECTION-UNSPECIFIED

What do you think about that?

I agree, we should not modify the generated code.
You proposal of updating the enums in the yaml file seems appropriate

@gab-arrobo
Copy link
Copy Markdown
Contributor

Overall, it looks good. I added some minor comments. BTW, if you need to create a release (i.e., tag), you need to modify the VERSION file

Hello @gab-arrobo, While I agree with your comments, all of the code in question has been auto generated by the openapi-generator. If I start changing the generated code, it will cause conflicts/changes every time we run the generator. Then we'll have to manually inspect every file to see what was changed and why and potentially revert the change manually.
Alternatively (for the consts specifically) I could update the enums in the webconsole-api.yaml, i.e.

Direction:
      type: string
      enum:
        - DIRECTION-DOWNLINK
        - DIRECTION-UPLINK
        - DIRECTION-BIDIRECTIONAL
        - DIRECTION-UNSPECIFIED

What do you think about that?

I agree, we should not modify the generated code. You proposal of updating the enums in the yaml file seems appropriate

No need to manually do that. There is an option to append the struct name as a prefix to the enums. Let me get back to you when I am in front of my computer.

@Gmerold
Copy link
Copy Markdown
Contributor Author

Gmerold commented Jul 10, 2025

Overall, it looks good. I added some minor comments. BTW, if you need to create a release (i.e., tag), you need to modify the VERSION file

Hello @gab-arrobo, While I agree with your comments, all of the code in question has been auto generated by the openapi-generator. If I start changing the generated code, it will cause conflicts/changes every time we run the generator. Then we'll have to manually inspect every file to see what was changed and why and potentially revert the change manually.
Alternatively (for the consts specifically) I could update the enums in the webconsole-api.yaml, i.e.

Direction:
      type: string
      enum:
        - DIRECTION-DOWNLINK
        - DIRECTION-UPLINK
        - DIRECTION-BIDIRECTIONAL
        - DIRECTION-UNSPECIFIED

What do you think about that?

I agree, we should not modify the generated code. You proposal of updating the enums in the yaml file seems appropriate

No need to manually do that. There is an option to append the struct name as a prefix to the enums. Let me get back to you when I am in front of my computer.

Thanks for the hint @gab-arrobo
Found it. It's enumClassPrefix=true. I'll fix the command in the README and the code.

@gab-arrobo
Copy link
Copy Markdown
Contributor

No need to manually do that. There is an option to append the struct name as a prefix to the enums. Let me get back to you when I am in front of my computer.

Thanks for the hint @gab-arrobo Found it. It's enumClassPrefix=true. I'll fix the command in the README and the code.

I think this should do the job:

npx openapi-generator-cli generate \
  -i ./webconsole-api.yaml \
  -g go \
  -o ./nfConfigApi \
  --additional-properties=packageName=nfConfigApi,validateRequired=true,enumClassPrefix=true

Signed-off-by: Bartlomiej Gmerek <bartlomiej.gmerek@canonical.com>
@Gmerold Gmerold force-pushed the add-qos-endpoint branch from f502f09 to 392ce7f Compare July 11, 2025 09:48
@Gmerold Gmerold requested a review from gab-arrobo July 11, 2025 09:51
Gmerold added 2 commits July 11, 2025 13:53
Signed-off-by: Bartlomiej Gmerek <bartlomiej.gmerek@canonical.com>
Signed-off-by: Bartlomiej Gmerek <bartlomiej.gmerek@canonical.com>
Copy link
Copy Markdown
Contributor

@gab-arrobo gab-arrobo left a comment

Choose a reason for hiding this comment

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

Please address issue with GHA

Gmerold and others added 2 commits July 14, 2025 08:57
@Gmerold Gmerold requested a review from gab-arrobo July 14, 2025 07:01
Signed-off-by: Bartlomiej Gmerek <bartlomiej.gmerek@canonical.com>
Signed-off-by: Bartlomiej Gmerek <bartlomiej.gmerek@canonical.com>
@Gmerold Gmerold requested a review from gab-arrobo July 14, 2025 19:09
@gab-arrobo
Copy link
Copy Markdown
Contributor

@Gmerold,
The changes look good to me. Only one quick question... did you try to re-generate the modesl/API using the latest changes (i.e., using templates (partial_header, api, README))?
BTW, you need to address the issue with the copyright/license header in the api.mustache template. If you cannot address in the file itself, you could create another file named api.mustache.license and add the copyright/license header there (similar to how it is done in the go.mod and go.mod.license files)

Signed-off-by: Bartlomiej Gmerek <bartlomiej.gmerek@canonical.com>
@Gmerold
Copy link
Copy Markdown
Contributor Author

Gmerold commented Jul 15, 2025

@Gmerold, The changes look good to me. Only one quick question... did you try to re-generate the modesl/API using the latest changes (i.e., using templates (partial_header, api, README))? BTW, you need to address the issue with the copyright/license header in the api.mustache template. If you cannot address in the file itself, you could create another file named api.mustache.license and add the copyright/license header there (similar to how it is done in the go.mod and go.mod.license files)

Hi @gab-arrobo,
Yes, I'm testing the generator after every change to make sure the result is correct.
api.mustache.license added.

Copy link
Copy Markdown
Contributor

@gab-arrobo gab-arrobo left a comment

Choose a reason for hiding this comment

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

+1

@gab-arrobo gab-arrobo merged commit a494e5f into omec-project:main Jul 15, 2025
6 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.

5 participants