Skip to content

feat(asset): add asset categorization support (#298)#297

Merged
SamuelHassine merged 3 commits into
mainfrom
feature/asset-categorization
Jun 27, 2026
Merged

feat(asset): add asset categorization support (#298)#297
SamuelHassine merged 3 commits into
mainfrom
feature/asset-categorization

Conversation

@SamuelHassine

@SamuelHassine SamuelHassine commented Jun 27, 2026

Copy link
Copy Markdown
Member

Summary

Adds the canonical two-level asset taxonomy to pyoaev so producers (collectors, custom integrations) can classify endpoints with the new fields introduced in OpenAEV.

Changes

  • New pyoaev.asset_types module with AssetCategory, AssetSubCategory, CloudProvider and AssetCriticality enums, exported from the package.
  • EndpointManager: asset_name is now the only required attribute; endpoint_hostname, endpoint_platform and endpoint_arch are optional (the platform defaults platform / arch to Unknown server-side). Added optional attrs asset_category, asset_subcategory, asset_criticality, asset_internet_facing, asset_cloud_provider, asset_cloud_native_type, asset_cloud_region, asset_metadata and endpoint_url.
  • Version bump.

Test plan

  • test/apis/endpoint/test_endpoint.py: upsert a web application without platform / arch and a cloud resource; assert the categorization fields are sent on the wire, that exactly one request is made, and that no endpoint_platform / endpoint_arch is sent for a category-driven asset.

Notes

  • Addressed the Copilot review: corrected the _create_attrs comment to match the actual validation rules, and hardened both upsert tests with assert_called_once() plus an assertion that platform / arch are omitted.
  • The security/snyk (Filigran) check fails with a Snyk account quota error ("You have used your limit of private tests"), unrelated to this change. All other checks (CircleCI build / test / linter / formatting, coverage, signed commits, linked issue, PR title) are green.

Related

Dependency of OpenAEV-Platform/openaev#6452 (asset categorization).

Closes #298

Add the canonical two-level asset taxonomy to pyoaev so producers (collectors, custom
integrations) can set the new categorization fields on endpoints:

- new AssetCategory / AssetSubCategory / CloudProvider / AssetCriticality enums in
  pyoaev.asset_types, exported from the package
- EndpointManager: endpoint_platform / endpoint_arch are now optional; add optional attrs
  asset_category, asset_subcategory, asset_criticality, asset_internet_facing,
  asset_cloud_provider, asset_cloud_native_type, asset_cloud_region, asset_metadata and
  endpoint_url
- bump the package version

Relates to OpenAEV-Platform/openaev#6452
Copilot AI review requested due to automatic review settings June 27, 2026 13:43
@github-actions github-actions Bot added the filigran team Item from the Filigran team. label Jun 27, 2026
@codecov

codecov Bot commented Jun 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.84%. Comparing base (8283bfe) to head (52cfb39).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #297      +/-   ##
==========================================
+ Coverage   73.58%   74.84%   +1.25%     
==========================================
  Files          54       55       +1     
  Lines        2404     2512     +108     
==========================================
+ Hits         1769     1880     +111     
+ Misses        635      632       -3     
Flag Coverage Δ
connectors 74.84% <100.00%> (+1.25%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds first-class asset categorization support to the Python client so endpoint producers can send the canonical (backend-aligned) asset taxonomy fields to OpenAEV.

Changes:

  • Introduces pyoaev.asset_types with AssetCategory, AssetSubCategory, CloudProvider, and AssetCriticality enums and exports them from pyoaev.
  • Expands EndpointManager allowed create payload attributes to include asset categorization/cloud metadata fields and makes platform/arch optional.
  • Bumps package version and adds endpoint upsert tests for categorization payload serialization.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
test/apis/endpoint/test_endpoint.py Adds tests asserting categorization fields are serialized on endpoint upsert calls.
pyoaev/asset_types.py New module defining canonical asset taxonomy and related enums as str enums.
pyoaev/apis/endpoint.py Updates endpoint create-attrs to support new categorization/cloud fields and relax platform/arch requirements.
pyoaev/init.py Version bump and re-exports new enums from the package root.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/apis/endpoint/test_endpoint.py
Comment thread test/apis/endpoint/test_endpoint.py
Comment thread pyoaev/apis/endpoint.py Outdated
…comment (#298)

Address review feedback on the asset categorization PR:

- endpoint.py: correct the _create_attrs comment to state that asset_name
  is the only required attribute and that endpoint_hostname / platform /
  arch are all optional (not just platform / arch).
- test_endpoint.py: assert the upsert performs exactly one HTTP request
  (assert_called_once) and that a category-driven asset upsert sends no
  endpoint_platform / endpoint_arch on the wire.
@SamuelHassine SamuelHassine changed the title feat(asset): add asset categorization support feat(asset): add asset categorization support (#298) Jun 27, 2026
@SamuelHassine

Copy link
Copy Markdown
Member Author

Review and fix summary

Reviewed the full changed files (not just the diff) and reconciled the PR with the repo conventions and CI.

What was done:

  • Independent review of asset_types.py, pyoaev/__init__.py, apis/endpoint.py and the endpoint tests. The str enums serialize correctly on the wire and the package re-exports are consistent.
  • Fixed the inaccurate _create_attrs comment in endpoint.py: asset_name is the only required attribute; endpoint_hostname / endpoint_platform / endpoint_arch are all optional.
  • Hardened both categorization upsert tests with assert_called_once() and added an assertion that a category-driven asset upsert sends no endpoint_platform / endpoint_arch.
  • Created issue feat(asset): add asset categorization support #298 (asset categorization) and linked it (Closes #298); updated the PR title to end with (#298). This turned both the "linked issue" check and the optional PR-title check green.
  • Replied to and resolved all 3 Copilot review threads.

Verification (local): python -m unittest for the endpoint tests passes (3/3); isort --check-only, black --check and flake8 --ignore=E,W are clean.

CI: CircleCI build / test / linter / formatting, coverage, signed commits, linked issue and PR title are all green.

Remaining (non-code blockers):

  • security/snyk (Filigran) fails with "You have used your limit of private tests" - a Snyk account quota issue, unrelated to this change.
  • 1 approving review is still required to merge; as the PR author I cannot self-approve, so a maintainer approval is the last step.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

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

Comment thread pyoaev/apis/endpoint.py Outdated
@SamuelHassine

Copy link
Copy Markdown
Member Author

Follow-up review round

Addressed the latest Copilot comment on endpoint.py: the _create_attrs comment used "the platform defaults endpoint_platform / endpoint_arch", where "platform" was ambiguous next to the endpoint_platform field. Reworded to "the backend defaults endpoint_platform / endpoint_arch to "Unknown"" so it clearly refers to server-side behavior.

Verification: isort, black and flake8 --ignore=E,W are clean on the changed file. CI is green (CircleCI build / test / linter / formatting, coverage, codecov, signed commits, linked issue, PR title); the only red check is security/snyk (Filigran), which fails on the Snyk account quota ("You have used your limit of private tests"), unrelated to this change.

The thread is resolved and the branch is MERGEABLE; the only outstanding item is the required maintainer approval (I cannot self-approve as the author).

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

@SamuelHassine SamuelHassine merged commit 1509239 into main Jun 27, 2026
13 of 14 checks passed
@SamuelHassine SamuelHassine deleted the feature/asset-categorization branch June 27, 2026 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

filigran team Item from the Filigran team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(asset): add asset categorization support

3 participants