Returns
Returns the Version object that holds these facts, whether the call found it or created it.Example
Parameters
dict[str, str]
required
The agent state the version represents, as a flat map of text to text. Galtea trims every key and
every value, drops an entry whose key or value is empty, and keeps the rest exactly, so
"0.7" and "0.70" are
two different facts. At least one entry must survive the trimming.string
Name to give the version, used only when this call creates one. A version the call finds keeps the
name it already has.
boolean
default:"False"
Record the commit of the machine that runs the SDK under the
commit_hash fact.Commit Hash Detection
Setauto_detect_commit_hash=True and the SDK adds one more fact, commit_hash. It reads the
commit in this order:
- The continuous-integration variable of the provider that runs the job. The SDK supports GitHub Actions, GitLab CI, CircleCI, Azure Pipelines, Bitbucket Pipelines, Travis CI, Buildkite, Drone, AWS CodeBuild, Semaphore, AppVeyor, TeamCity, Vercel and Jenkins.
git rev-parse HEADin the current directory.
- Detection describes the machine that runs the SDK. It reports the commit that machine has checked out. It ignores every edit you have not committed, so a changed working copy records the commit it started from.
- A
commit_hashyou put infactsyourself always wins. Detection never replaces it. - The SDK omits the fact when it finds no commit. It never sends a made-up or empty value.