Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions extensions/commands/art/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ Then upload the created package to your repository:
conan upload ... -c -r <conan-remote>
```

**Important**: Make sure to upload the packages _before_ creating a Build Info so conan_exports.tgz or conan_package.tgz
files are generated. Otherwise, the created Build Info might be incomplete.

Using the generated JSON files you can create a Build Info JSON file. To do this, you need to provide the build
name and number. You will also need to indicate the artifactory server to use and the name of repository where the packages were uploaded in Artifactory (probably **not** the same one as the Conan remote name):

Expand Down
5 changes: 5 additions & 0 deletions extensions/commands/art/cmd_build_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,11 @@ def _get_remote_artifacts(artifact):
return artifact_info

artifacts, missing = _get_local_artifacts()
if missing:
tgz_items = {item for item in missing if item.endswith(".tgz") and "conan_sources.tgz" not in item}
if tgz_items:
ConanOutput().warning(f"There are missing .tgz files ({','.join(tgz_items)}). Make sure to upload the "
f"packages to Artifactory before creating a BuildInfo")

if 'conan_sources.tgz' in missing:
# check if we have the conan_sources in Artifactory, if it's not there
Expand Down
14 changes: 14 additions & 0 deletions tests/test_build_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,3 +200,17 @@ def test_formatted_time():
current_utc = datetime.datetime.now(datetime.timezone.utc)
assert timestamp_utc.replace(minute=0, second=0, microsecond=0) == \
current_utc.replace(minute=0, second=0, microsecond=0)


def test_missing_files_warning():
"""
Test that a warning is issued when .tgz files are missing from the build-info JSON
"""
run("conan new header_lib -d name=lib1 -d version=1.0")
run("conan create . -f json > create.json")
graph = json.loads(load("create.json"))["graph"]
_fake_conan_sources(graph)

out = run("conan art:build-info create create.json build_name 1 repo --with-dependencies > bi.json")
assert "WARN: There are missing .tgz files (conan_export.tgz)" in out
assert "WARN: There are missing .tgz files (conan_package.tgz)" in out
Loading