Skip to content

Conversation

@vista-
Copy link
Contributor

@vista- vista- commented Nov 21, 2025

A quick proof-of-concept code I whipepd up on a long train ride based on #2949.

Works similarly as the magic node name variables that can get substituted in, except for the topology name. I have done some cursory testing, but didn't want to over-commit on that before I get some feedback on the overall idea.

This could help with use-cases involving Containerlab in multi-tenant labs and CI/CD environments, where the runner isn't a temporary environment.

@vista- vista- requested review from hellt and kaelemc November 21, 2025 07:20
@vista- vista- marked this pull request as draft November 21, 2025 07:24
@codecov
Copy link

codecov bot commented Nov 21, 2025

Codecov Report

❌ Patch coverage is 0% with 35 lines in your changes missing coverage. Please review.
✅ Project coverage is 55.46%. Comparing base (72f9051) to head (da93d25).

Files with missing lines Patch % Lines
core/config.go 0.00% 34 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2951      +/-   ##
==========================================
- Coverage   55.50%   55.46%   -0.04%     
==========================================
  Files         218      218              
  Lines       21561    21596      +35     
==========================================
+ Hits        11967    11978      +11     
- Misses       8367     8391      +24     
  Partials     1227     1227              
Files with missing lines Coverage Δ
core/config.go 66.03% <0.00%> (-5.95%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment on lines +44 to +46
// clab name specific variables
gitBranchVar = "__gitBranch__"
gitHashVar = "__gitHash__"
Copy link
Member

Choose a reason for hiding this comment

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

I think it would make sense to record the branch and hash as node labels as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll add this and move the PR to a ready to review state once I have some free time - hopefully soon.

)
}

// magicVarReplacer returns a string replacer that replaces all supported magic variables.
Copy link
Member

Choose a reason for hiding this comment

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

looks like the comment needs to be adjusted to only mention specific variables?

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.

3 participants