Add version pinning logic in explore/project areas for FLOWS
What does this MR do and why?
Add version pinning logic in explore and project areas for flows only. The meta-data component will come in a later MR.
- Add
showLatestVersionprop and pass thru to children - Added tests to parent and leaf components
- Clarified test names and aligned some code style
References
This MR depends on Add pinnedItemVersion field to catalog GraphQL ... (!213420 - merged), which provides the needed GraphQL query updates to function.
This MR also depends on Add version pinning logic in explore/project ar... (!213429 - merged), which provides changes to the shared components agents and flows use.
Screenshots or screen recordings
| Before | After |
|---|---|
How to set up and validate locally
- Make sure to have a duo enabled project with the
global_ai_catalogfeature flag enabled - In the AI catalog, create a new flow and take note of the definition
- Enable this flow in a duo enabled project
- Navigate to that project’s Automate > Flows page and click on the flow you created
- You should see that the definition it the same as what you started with
- Also check the EDIT and DUPLICATE pages to ensure they start with the same definition
- Navigate back to the Explorer area and make an update to that flow's definition
- Navigate back to that same flow in your duo enable and click on it to see its details
- You should see that its definition is still the original version you started with. This is because it has been pinned to that version and updates to the global flow item should not affect it.
- Also check the EDIT and DUPLICATE pages to ensure they start with the UPDATED flow
Pin the flow to a new version
- Now open up a rails console and update the pinned version of the flow you've been working with to v1.1.0
Ai::Catalog::ItemConsumer.last.update!(pinned_version_prefix: '1.1.0')
- Reload the project level flow page
- You should see that the flow is now aligned with the latest version
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #580382 (closed)
Edited by Angus Ryer