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

MG-2236 - Add Constraints Service Provider #2274

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

WashingtonKK
Copy link
Contributor

What type of PR is this?

This is a feature because it adds a constraint provider to magistrala.

What does this do?

This introduces a constraint provider to magistrala that reads constraints from a toml file and uses this to limit the entities created.

Which issue(s) does this PR fix/relate to?

Have you included tests for your changes?

Yes, I have included tests for my changes.

Did you document any new/modified feature?

Yes, I have updated the documentation for the new feature.

Notes

@arvindh123
Copy link
Contributor

arvindh123 commented Jun 5, 2024

|-- constraints
|   |-- config
|   |   |-- configprovider.go
|--constraints.go

@WashingtonKK What do you think about this folder structure, inside pkg dir
But again it like similar to repo folder structure

@arvindh123
Copy link
Contributor

|-- constraints
|   |-- config
|   |   |-- configprovider.go
|--constraints.go

@WashingtonKK What do you think about this folder structure, inside pkg dir But again it like similar to repo folder structure

In future we can add other providers

like example

|-- constraints
|   |-- config
|   |   |-- configprovider.go
|   |-- strip
|   |   |-- stripprovider.go
|--constraints.go

@WashingtonKK
Copy link
Contributor Author

|-- constraints
|   |-- config
|   |   |-- configprovider.go
|--constraints.go

@WashingtonKK What do you think about this folder structure, inside pkg dir But again it like similar to repo folder structure

In future we can add other providers

like example

|-- constraints
|   |-- config
|   |   |-- configprovider.go
|   |-- strip
|   |   |-- stripprovider.go
|--constraints.go

@arvindh123 I think this is a good idea, since it will make it easy for us to add more providers. I will update it to that

@WashingtonKK WashingtonKK force-pushed the MG-2236 branch 2 times, most recently from 950a7fe to 9c3a7a8 Compare June 6, 2024 03:25
@WashingtonKK WashingtonKK marked this pull request as ready for review June 6, 2024 06:31
@WashingtonKK WashingtonKK self-assigned this Jun 7, 2024
Copy link
Contributor

@arvindh123 arvindh123 left a comment

Choose a reason for hiding this comment

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

Please try the suggetion

constraints_config.toml Outdated Show resolved Hide resolved
constraints.go Outdated Show resolved Hide resolved
pkg/constraints/constraints.go Outdated Show resolved Hide resolved
constraints.go Outdated Show resolved Hide resolved
pkg/constraints/config/configProvider.go Outdated Show resolved Hide resolved
@WashingtonKK WashingtonKK force-pushed the MG-2236 branch 3 times, most recently from 258c1d8 to 7e1a348 Compare June 12, 2024 08:37
@dborovcanin dborovcanin marked this pull request as draft June 12, 2024 10:13
Signed-off-by: WashingtonKK <[email protected]>

initial service layout

Signed-off-by: WashingtonKK <[email protected]>

pilot test with users service

Signed-off-by: WashingtonKK <[email protected]>

remove config

Signed-off-by: WashingtonKK <[email protected]>

refactor constraints

Signed-off-by: WashingtonKK <[email protected]>

revert service creation

Signed-off-by: WashingtonKK <[email protected]>

change to constraint provider

Signed-off-by: WashingtonKK <[email protected]>

refactor: switch from service to provider

Signed-off-by: WashingtonKK <[email protected]>

refactor constraints

Signed-off-by: WashingtonKK <[email protected]>

refactor: change directory structure

Signed-off-by: WashingtonKK <[email protected]>
Signed-off-by: WashingtonKK <[email protected]>

refactor limit enforcement

Signed-off-by: WashingtonKK <[email protected]>

refactor limit enforcement

Signed-off-by: WashingtonKK <[email protected]>

refactor limit enforcement

Signed-off-by: WashingtonKK <[email protected]>

fix ci

Signed-off-by: WashingtonKK <[email protected]>

fix: tests

Signed-off-by: WashingtonKK <[email protected]>

fix: tests

Signed-off-by: WashingtonKK <[email protected]>

fix api tests

Signed-off-by: WashingtonKK <[email protected]>

rename config file

Signed-off-by: WashingtonKK <[email protected]>
Signed-off-by: WashingtonKK <[email protected]>
Signed-off-by: WashingtonKK <[email protected]>
Signed-off-by: WashingtonKK <[email protected]>
Signed-off-by: WashingtonKK <[email protected]>
Signed-off-by: WashingtonKK <[email protected]>

refactor limit enforcement

Signed-off-by: WashingtonKK <[email protected]>

refactor limit enforcement

Signed-off-by: WashingtonKK <[email protected]>

refactor limit enforcement

Signed-off-by: WashingtonKK <[email protected]>

fix ci

Signed-off-by: WashingtonKK <[email protected]>

fix: tests

Signed-off-by: WashingtonKK <[email protected]>

fix: tests

Signed-off-by: WashingtonKK <[email protected]>

fix api tests

Signed-off-by: WashingtonKK <[email protected]>

rename config file

Signed-off-by: WashingtonKK <[email protected]>

tmp

Signed-off-by: WashingtonKK <[email protected]>

tmp2

Signed-off-by: WashingtonKK <[email protected]>

tmp3

Signed-off-by: WashingtonKK <[email protected]>
Signed-off-by: WashingtonKK <[email protected]>
Signed-off-by: WashingtonKK <[email protected]>
Signed-off-by: WashingtonKK <[email protected]>
Signed-off-by: WashingtonKK <[email protected]>
Signed-off-by: WashingtonKK <[email protected]>
@WashingtonKK WashingtonKK marked this pull request as ready for review June 13, 2024 07:08
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.

Feature: Service configuration
2 participants