Skip to content

ACLP: Cleanup entity related response fields from alert definition#690

Merged
yec-akamai merged 7 commits into
linode:devfrom
shkaruna:cleanup/entity-related-fields
May 5, 2026
Merged

ACLP: Cleanup entity related response fields from alert definition#690
yec-akamai merged 7 commits into
linode:devfrom
shkaruna:cleanup/entity-related-fields

Conversation

@shkaruna
Copy link
Copy Markdown
Contributor

📝 Description

Cleanup entity related response fields from alert definition.
Removed entity_ids and has_more_resources response fields of ACLP alerting APIs.
Updated test cases.

✔️ How to Test

What are the steps to reproduce the issue or verify the changes?
Not applicable

How do I run the relevant unit/integration tests?
Prerequisites:
Clone the repository
Prepare environment (zsh / macOS)

Create and activate venv:
python3 -m venv .venv
source .venv/bin/activate

install deps
python -m pip install --upgrade pip

Install runtime dependencies:
pip3 install requests polling deprecated

Install dev/test extras
pip3 install -e '.[dev,test]'

test deps
pip3 install pytest mock httpretty pytest-rerunfailures

Unit test:

Run all unit tests:
python -m pytest test/unit -q

Run Monitor alert channels unit tests:

python -m pytest test/unit/groups/monitor_api_test.py -q -s
....
4 passed in 0.13s

Integration test:
#if you have PAT token with write access only to Monitor and read for rest of the services for integration
export SKIP_E2E_FIREWALL=1 # optional: skip firewall to use fixture
export LINODE_TOKEN="YOUR_REAL_TOKEN" # required for integration
python -m pytest test/integration/models/monitor/test_monitor.py::test_integration_create_get_update_delete_alert_definition -q -s
.
1 passed in 12.57s

shkaruna added 6 commits April 8, 2026 22:28
Add entities envelope in AlertDefinition. Add list entities GET API method. Add tests.
Remove entity_ids and has_more_resources response fields
parent_id_name = "service_type"
id_attribute = "id"

properties = {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I find channel_ids is missing in the properties in previous implemenatation. Can you add it please? It's not in the response struct, but should be updatable just like entity_ids.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks Ye. I have updated the properties.

Copy link
Copy Markdown

@satkumar-akamai satkumar-akamai left a comment

Choose a reason for hiding this comment

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

LGTM

@shkaruna shkaruna marked this pull request as ready for review May 5, 2026 04:33
@shkaruna shkaruna requested review from a team as code owners May 5, 2026 04:33
@shkaruna shkaruna requested review from ckulinsk and yec-akamai and removed request for a team May 5, 2026 04:33
@mawilk90 mawilk90 requested a review from zliang-akamai May 5, 2026 07:05
@yec-akamai yec-akamai added the community-contribution for contributions made by a non-DX author label May 5, 2026
Copy link
Copy Markdown
Contributor

@yec-akamai yec-akamai left a comment

Choose a reason for hiding this comment

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

LGTM. Tests passed locally

@yec-akamai yec-akamai added the improvement for improvements in existing functionality in the changelog. label May 5, 2026
@yec-akamai yec-akamai merged commit 4fec1e5 into linode:dev May 5, 2026
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution for contributions made by a non-DX author improvement for improvements in existing functionality in the changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants