Build Activity Stream links for inventory source sync schedules - #389
Merged
Merged
Conversation
The Activity Stream description for a schedule that belongs to an inventory source sync hit an explicit 'not implemented yet' throw and fell back to plain unlinked text, because the inventory-source schedule url (/inventories/inventory/<inventory_id>/sources/<id>/schedules/...) needs the parent inventory id, which the activity stream serializer did not provide. API: ActivityStreamSerializer._summarize_parent_ujt now includes inventory_id when the schedule's parent unified job template is an InventorySource (the direct inventory_source summary gains it too, mirroring the existing group/inventory_id special case). UI: ActivityStreamDescription builds the link from summary_fields.inventory_source, and falls back to plain text when the inventory id is unavailable instead of relying on the thrown exception. Closes the first 'known bug' from the UI gaps list.
This was referenced Jun 11, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request fixes Activity Stream rendering for schedules belonging to inventory source syncs by providing the missing parent inventory_id in the API serializer and updating the UI to build the correct inventory-source schedule URL (with a safe plain-text fallback when the URL can’t be constructed).
Changes:
- API: Extend
ActivityStreamSerializerschedule-parent summarization so inventory-source schedule activities includesummary_fields.inventory_source[0].inventory_id. - UI: Teach
ActivityStreamDescriptionto build/inventories/inventory/<inventory_id>/sources/<source_id>/schedules/<schedule_id>/links for inventory-source schedules without relying on an exception path. - Tests: Add a functional API regression test and UI tests covering both link building and graceful fallback behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| awx/ui/src/screens/ActivityStream/ActivityStreamDescription.test.js | Adds UI tests for inventory-source schedule link generation and plain-text fallback. |
| awx/ui/src/screens/ActivityStream/ActivityStreamDescription.js | Adds inventory-source schedule URL building based on summary_fields.inventory_source. |
| awx/main/tests/functional/api/test_activity_streams.py | Adds API functional test asserting inventory_id is serialized for inventory-source schedule activities. |
| awx/api/serializers.py | Adds inventory_id to relevant Activity Stream summary serialization for inventory sources (including schedule-parent summarization). |
cigamit
approved these changes
Jun 12, 2026
cigamit
left a comment
Collaborator
There was a problem hiding this comment.
Tested and the name is now properly linked in Activity Stream.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SUMMARY
The Activity Stream description for a schedule belonging to an inventory source sync hit an explicit
throw new Error('activity.summary_fields to build this url not implemented yet')and fell back to plain unlinked text — every other schedule parent (job template, workflow job template, project) gets a clickable link.The blocker was that the inventory-source schedule route (
/inventories/inventory/<inventory_id>/sources/<id>/schedules/<schedule_id>/) needs the parent inventory id, which the activity stream serializer didn't provide.ActivityStreamSerializer._summarize_parent_ujtnow includesinventory_idwhen a schedule's parent unified job template is anInventorySource(the directinventory_sourcesummary gains it too, mirroring the existinggroup/inventory_idspecial case a few lines above).ActivityStreamDescriptionbuilds the link fromsummary_fields.inventory_source, falling back to plain text when the id is unavailable rather than relying on a thrown exception for control flow.Tests: a functional API test asserting
inventory_idis serialized for an inventory-source schedule activity, and two UI tests (link built with the right href; graceful plain-text fallback for unknown parents).Independent of all open PRs — no dependency or lockfile changes.
ISSUE TYPE
COMPONENT NAME
ASCENDER VERSION
ADDITIONAL INFORMATION
Reproduce on main: create a schedule on an inventory source, then open the Activity Stream — the schedule entry renders as plain text instead of a link (the throw is caught upstream).