Skip to content

Conversation

@kpom-specter
Copy link
Contributor

@kpom-specter kpom-specter commented Jan 21, 2026

  • Add NewTestService helper for configurable test overrides
  • Update UpdateAssetGroupTag to use DogTags.GetFlagAsBool
  • Update tests to use NewTestService with appropriate overrides

Description

Describe your changes in detail

Motivation and Context

Resolves <TICKET_OR_ISSUE_NUMBER>

Why is this change required? What problem does it solve?

How Has This Been Tested?

Please describe in detail how you tested your changes.
Include details of your testing environment, and the tests you ran to
see how your change affects other areas of the code, etc.

Screenshots (optional):

Types of changes

  • Chore (a change that does not modify the application functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Database Migrations

Checklist:

Summary by CodeRabbit

  • Refactor

    • Centralized feature-flag handling moved to a dedicated dogtags service, updating how multi-tier analysis is evaluated.
  • Tests

    • Test infrastructure enhanced with a configurable dogtags test service and updated tests to use it.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 21, 2026

Walkthrough

Replaced a tiering-parameter multi-tier analysis check with the DogTags feature-flag in UpdateAssetGroupTag and wired a testable DogTags service into asset group tag tests; added a test Service implementation and overrides for dogtags.

Changes

Cohort / File(s) Summary
API Endpoint Update
cmd/api/src/api/v2/assetgrouptags.go
Added dogtags import and replaced appcfg.GetTieringParameters(...).MultiTierAnalysisEnabled with s.DogTags.GetFlagAsBool(dogtags.PZ_MULTI_TIER_ANALYSIS) in UpdateAssetGroupTag.
Test Fixtures & Wiring
cmd/api/src/api/v2/assetgrouptags_test.go
Added DogTags dogtags.Service to test Resources and initialized it via dogtags.NewDefaultService() or dogtags.NewTestService(...) across many asset-group-tag tests.
DogTags Service Extensions
cmd/api/src/services/dogtags/service.go
Introduced TestOverrides and NewTestService(overrides) returning an internal testService with override-aware methods (GetFlagAsBool, GetFlagAsInt, GetFlagAsString, GetAllDogTags) for testing.

Sequence Diagram(s)

(omitted)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

api, enhancement

Suggested reviewers

  • irshadaj
  • mistahj67
  • seanjSO

Poem

🐰 I nibbled flags beneath the moon,
Wired DogTags quick — a clever tune,
Tests now hop with overrides bright,
Tiering's check replaced tonight,
Code hops forward, tails in flight! 🥕

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description check ⚠️ Warning The description includes initial bullet points summarizing changes but fails to complete required template sections. Critical fields like 'Description,' 'Motivation and Context,' and 'How Has This Been Tested' contain only placeholder text or are left empty, violating the repository's contribution requirements. Complete all required template sections: replace placeholder text in Description, Motivation and Context, and How Has This Been Tested; confirm checklist items are properly addressed; ensure the associated Jira ticket BED-6938 is explicitly mentioned in the Motivation section.
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically summarizes the main change: replacing GetTieringParameters with dogtags for multi-tier analysis flagging, directly matching the refactoring shown in the code changes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@cmd/api/src/services/dogtags/service.go`:
- Around line 39-83: testService.GetAllDogTags currently only adds bool and int
tags; update it to also iterate AllStringDogTags and add those entries using
s.GetFlagAsString(key) so testService mirrors the production service; locate the
method testService.GetAllDogTags and append a loop over AllStringDogTags that
sets result[string(key)] = s.GetFlagAsString(key).

  - Add NewTestService helper for configurable test overrides
  - Update UpdateAssetGroupTag to use DogTags.GetFlagAsBool
  - Update tests to use NewTestService with appropriate overrides
@kpom-specter kpom-specter force-pushed the kpom/BED-6938/pz-plumbing branch from b80b60b to 92020b1 Compare January 23, 2026 15:00
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.

2 participants