_stream: use full element name in artifact log/list-contents - #2174
Open
c1assik wants to merge 1 commit into
Open
_stream: use full element name in artifact log/list-contents#2174c1assik wants to merge 1 commit into
artifact log/list-contents#2174c1assik wants to merge 1 commit into
Conversation
c1assik
marked this pull request as ready for review
August 15, 2026 09:08
c1assik
requested review from
BenjaminSchubert,
abderrahim,
cs-shadow,
gtristan and
juergbi
as code owners
August 15, 2026 09:08
| continue | ||
|
|
||
| artifact_logs[obj.name] = obj._get_logs() | ||
| name = ref if isinstance(obj, ArtifactElement) else obj._get_full_name() |
Contributor
There was a problem hiding this comment.
Perhaps it would be better if ArtifactElement overrode the _get_full_name method or the __full_name variable, instead of having this awkward condition here?
Suggested change
| name = ref if isinstance(obj, ArtifactElement) else obj._get_full_name() | |
| name = obj._get_full_name() |
In ArtifactElement
def _get_full_name(self)
return self.get_artifact_name()
Author
There was a problem hiding this comment.
Added a method _get_full_name() to ArtifactElement.
return self.get_artifact_name(), unconditionally fails with AssertionError: assert key is not None in get_artifact_name() so if the cache key isn't set yet, fall back to super()._get_full_name() (the base Plugin/Element name, which is always safe since it's precomputed earlier in Plugin.init). Once construction finishes and the key is set, it returns the full artifact ref as intended
`artifact_log()` and `artifact_list_contents()` were keying their
result dicts by `obj.name`, which is just the bare, project-relative
element name. For elements loaded across a junction, this drops the
owning junction prefix, so e.g. `bst artifact list-contents
element.bst nested.bst:element.bst` would only show one entry, since
both targets resolved to the same key.
Use `obj._get_full_name()` instead, which includes the junction
prefix, falling back to the artifact ref for `ArtifactElement`
targets (i.e. when an artifact is referred to by its ref rather than
its element name) as before.
Also drops a dead `obj.name = {ref: "No artifact cached"}` assignment
in `artifact_list_contents()` that was immediately followed by
`continue` and never used.
Add tests covering `artifact log` and `artifact list-contents` with a
cross-junction element alongside a same-named top-level element.
c1assik
force-pushed
the
fix/artifact_full_name
branch
from
August 17, 2026 17:18
cdbdea6 to
30fd1a2
Compare
Contributor
|
LGTM |
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.
artifact_log()andartifact_list_contents()were keying their result dicts byobj.name, which is just the bare, project-relative element name. For elements loaded across a junction, this drops the owning junction prefix, so e.g.bst artifact list-contents element.bst nested.bst:element.bstwould only show one entry, since both targets resolved to the same key.Use
obj._get_full_name()instead, which includes the junction prefix, falling back to the artifact ref forArtifactElementtargets (i.e. when an artifact is referred to by its ref rather than its element name) as before.Also drops a dead
obj.name = {ref: "No artifact cached"}assignment inartifact_list_contents()that was immediately followed bycontinueand never used.Add tests covering
artifact logandartifact list-contentswith a cross-junction element alongside a same-named top-level element.