From 663e9eb306db39e66c64004062418b3b2df79b36 Mon Sep 17 00:00:00 2001 From: Marko Bevc Date: Thu, 26 Nov 2026 10:19:00 +0000 Subject: [PATCH 1/2] docs(snapshot s3): say separate artifacts need separate environments The long description told users to run the command twice to report separate files or dirs as separate artifacts. Since #1410 every S3 artifact is named after the bucket, and a snapshot replaces the environment's previous one, so two runs against one environment leave only the second. The text now says to run once per subset with --include, each against its own environment. Also reword the flags-auth example comment from "what is running in" a bucket to "the contents of" it, matching the other examples. --- cmd/kosli/snapshotS3.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/kosli/snapshotS3.go b/cmd/kosli/snapshotS3.go index 605ed0c07..d55276af5 100644 --- a/cmd/kosli/snapshotS3.go +++ b/cmd/kosli/snapshotS3.go @@ -12,7 +12,7 @@ const snapshotS3ShortDesc = `Report a snapshot of the content of an AWS S3 bucke const snapshotS3LongDesc = snapshotS3ShortDesc + awsAuthDesc + ` You can report the entire bucket content, or filter some of the content using ^--include^ / ^--exclude^ (literal prefix match) or ^--include-regex^ / ^--exclude-regex^ (Go regular expressions matched against the full object key). -In all cases, the content is reported as one artifact, named after the bucket. If you wish to report separate files/dirs within the same bucket as separate artifacts, you need to run the command twice. +In all cases, the content is reported as one artifact, named after the bucket. To report separate files/dirs within the same bucket as separate artifacts, run the command once per subset with ^--include^, each time against a different environment: a snapshot replaces the environment's previous one, and every artifact is named after the bucket. The fingerprint is the one ^kosli fingerprint^ gives for a local copy of the reported content: ^--artifact-type file^ when a single object is reported, ^--artifact-type dir^ otherwise. A bucket with nothing to report is not an error. Whether it holds no objects or the filters leave none, it is still reported as one artifact named after the bucket, with the fingerprint of an empty directory (^e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855^) and a timestamp of 0. When filters are what left nothing, a warning is logged, since a mistyped filter has the same effect. Object keys are never used as local file names: by default each object is downloaded to a temporary file, hashed and removed, and the fingerprint is computed from the keys and the content digests, so any key S3 accepts can be fingerprinted on any operating system. @@ -37,7 +37,7 @@ kosli snapshot s3 yourEnvironmentName \ --api-token yourAPIToken \ --org yourOrgName -# report what is running in an AWS S3 bucket (AWS auth provided in flags): +# report the contents of an entire AWS S3 bucket (AWS auth provided in flags): kosli snapshot s3 yourEnvironmentName \ --bucket yourBucketName \ --aws-key-id yourAWSAccessKeyID \ From bed304def46c44e71898493a14f65ff7892166e2 Mon Sep 17 00:00:00 2001 From: Marko Bevc Date: Thu, 26 Nov 2026 10:19:03 +0000 Subject: [PATCH 2/2] docs(snapshot s3): shorten the separate-artifacts sentence The sentence named only --include, although --include-regex and the exclude filters can also split a bucket into subsets, and it ended by repeating that the artifact is named after the bucket. It now offers --include as an example and keeps only the reason that matters: a snapshot replaces the environment's previous one. --- cmd/kosli/snapshotS3.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/kosli/snapshotS3.go b/cmd/kosli/snapshotS3.go index d55276af5..5207c13bd 100644 --- a/cmd/kosli/snapshotS3.go +++ b/cmd/kosli/snapshotS3.go @@ -12,7 +12,7 @@ const snapshotS3ShortDesc = `Report a snapshot of the content of an AWS S3 bucke const snapshotS3LongDesc = snapshotS3ShortDesc + awsAuthDesc + ` You can report the entire bucket content, or filter some of the content using ^--include^ / ^--exclude^ (literal prefix match) or ^--include-regex^ / ^--exclude-regex^ (Go regular expressions matched against the full object key). -In all cases, the content is reported as one artifact, named after the bucket. To report separate files/dirs within the same bucket as separate artifacts, run the command once per subset with ^--include^, each time against a different environment: a snapshot replaces the environment's previous one, and every artifact is named after the bucket. +In all cases, the content is reported as one artifact, named after the bucket. To report separate files/dirs within the same bucket as separate artifacts, run the command once per subset (e.g. with ^--include^), each against a different environment, since a snapshot replaces the environment's previous one. The fingerprint is the one ^kosli fingerprint^ gives for a local copy of the reported content: ^--artifact-type file^ when a single object is reported, ^--artifact-type dir^ otherwise. A bucket with nothing to report is not an error. Whether it holds no objects or the filters leave none, it is still reported as one artifact named after the bucket, with the fingerprint of an empty directory (^e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855^) and a timestamp of 0. When filters are what left nothing, a warning is logged, since a mistyped filter has the same effect. Object keys are never used as local file names: by default each object is downloaded to a temporary file, hashed and removed, and the fingerprint is computed from the keys and the content digests, so any key S3 accepts can be fingerprinted on any operating system.