Skip to content

chore(deps): update module github.com/spf13/pflag to v1.0.10#930

Merged
ocmbot[bot] merged 1 commit into
mainfrom
renovate/patch-spf13
Sep 25, 2025
Merged

chore(deps): update module github.com/spf13/pflag to v1.0.10#930
ocmbot[bot] merged 1 commit into
mainfrom
renovate/patch-spf13

Conversation

@ocmbot

@ocmbot ocmbot Bot commented Sep 25, 2025

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Type Update Change OpenSSF
github.com/spf13/pflag indirect patch v1.0.9 -> v1.0.10 OpenSSF Scorecard

Release Notes

spf13/pflag (github.com/spf13/pflag)

v1.0.10

Compare Source

What's Changed

  • fix deprecation comment for (FlagSet.)ParseErrorsWhitelist by @​thaJeztah in #​447
  • remove uses of errors.Is, which requires go1.13, move go1.16/go1.21 tests to separate file by @​thaJeztah in #​448

New Contributors

Full Changelog: spf13/pflag@v1.0.9...v1.0.10


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot.

@ocmbot ocmbot Bot requested a review from a team as a code owner September 25, 2025 08:19
@ocmbot ocmbot Bot enabled auto-merge (squash) September 25, 2025 08:19
@github-actions github-actions Bot added kind/chore chore, maintenance, etc. kind/dependency dependency update, etc. size/xs Extra small labels Sep 25, 2025
@ocmbot ocmbot Bot force-pushed the renovate/patch-spf13 branch from 71bd185 to 171a95d Compare September 25, 2025 10:06
@ocmbot ocmbot Bot force-pushed the renovate/patch-spf13 branch from 171a95d to 9717bfb Compare September 25, 2025 10:14
@ocmbot ocmbot Bot force-pushed the renovate/patch-spf13 branch from 9717bfb to b1fd15d Compare September 25, 2025 12:35
@ocmbot ocmbot Bot force-pushed the renovate/patch-spf13 branch from b1fd15d to 0437361 Compare September 25, 2025 12:43
@ocmbot ocmbot Bot merged commit 0fa797b into main Sep 25, 2025
18 checks passed
@ocmbot ocmbot Bot deleted the renovate/patch-spf13 branch September 25, 2025 12:45
matthiasbruns added a commit to matthiasbruns/open-component-model that referenced this pull request Mar 26, 2026
On-behalf-of: SAP <matthias.bruns@sap.com>
Signed-off-by: Matthias Bruns <git@matthiasbruns.com>
matthiasbruns added a commit to matthiasbruns/open-component-model that referenced this pull request Mar 26, 2026
On-behalf-of: SAP <matthias.bruns@sap.com>
Signed-off-by: Matthias Bruns <git@matthiasbruns.com>

# Conflicts:
#	cli/cmd/transfer/component-version/cmd.go
matthiasbruns added a commit that referenced this pull request Mar 27, 2026
#### What this PR does / why we need it

Adds a `--transfer-spec` flag to `ocm transfer component-version` that
enables a two-step transfer workflow:

1. **Generate** the transfer spec via `--dry-run -o yaml` and save it to
a file
2. **Edit** the spec (e.g., change the target registry, remove
transformations)
3. **Execute** the modified spec via `--transfer-spec <file>`

This gives users full control over the TransformationGraphDefinition
before execution.

**Changes:**
- New `--transfer-spec` flag accepting a file path (or `-` for stdin)
- Custom argument validator: 0 args when `--transfer-spec` is set,
exactly 2 otherwise (source, destination)
- `loadTransferSpec()` function for reading and deserializing YAML/JSON
specs
- `buildGraphDefinitionFromArgs()` extracted for cleaner code structure
- Updated command description and examples documenting the workflow

#### Which issue(s) this PR fixes

Contributes
open-component-model/ocm-project#930

#### Testing

##### How to test the changes

```bash
# Step 1: Generate a transfer spec
ocm transfer cv --dry-run -o yaml ctf::./my-archive//ocm.software/mycomponent:1.0.0 ghcr.io/my-org/ocm > spec.yaml

# Step 2: Edit spec.yaml (e.g. change target registry)

# Step 3: Execute the modified spec
ocm transfer cv --transfer-spec spec.yaml
```

##### Verification

- [x] I have tested the changes locally by running `ocm`

```bash
#!/bin/zsh
#
# Test script for the --transfer-spec feature (issue #930).
# Demonstrates the two-step transfer workflow:
#   1. Generate a transfer spec via --dry-run
#   2. Edit the spec (change target registry)
#   3. Execute the modified spec via --transfer-spec
#
# Prerequisites:
#   - Authenticated to both REGISTRY and REGISTRY2 (e.g. via docker login / gh auth)
#   - Go installed (uses go run)

set -euo pipefail

alias OCM='go run ../../main.go'
REGISTRY="ghcr.io/matthiasbruns/ocm-tutorials"
REGISTRY2="ghcr.io/matthiasbruns/ocm-tutorials-2"

pause() {
  echo "\n>>> Next: $1"
  echo "--- Press Enter to continue ---"
  read
}

# ── Step 1: Create a source CTF archive ──────────────────────────────────────

cat <<EOF > constructor.yaml
components:
- name: ocm.software/transfer-spec-test
  version: 1.0.0
  provider:
    name: ocm.software
  resources:
  - name: test-resource
    version: 1.0.0
    type: plainText
    input:
      type: utf8
      text: "Hello from transfer-spec test!"
EOF

CTF_DIR=$(mktemp -d)
echo "Using temporary directory for CTF: $CTF_DIR"

OCM add cv --repository ctf::$CTF_DIR --constructor constructor.yaml

SOURCE_REF="ctf::$CTF_DIR//ocm.software/transfer-spec-test:1.0.0"

pause "Generate transfer spec via --dry-run (targeting $REGISTRY)"

# ── Step 2: Generate transfer spec targeting REGISTRY ────────────────────────

SPEC_FILE=$(mktemp).yaml
echo "Writing transfer spec to: $SPEC_FILE"

OCM transfer component-version $SOURCE_REF $REGISTRY \
  --dry-run -o yaml \
  --copy-resources \
  > $SPEC_FILE

echo "\n=== Generated Transfer Spec ==="
cat $SPEC_FILE
echo "=== End of Transfer Spec ===\n"

pause "Modify the spec to target $REGISTRY2 instead of $REGISTRY"

# ── Step 3: Edit the spec to change the target registry ──────────────────────

MODIFIED_SPEC_FILE=$(mktemp).yaml
sed "s|${REGISTRY}|${REGISTRY2}|g" $SPEC_FILE > $MODIFIED_SPEC_FILE

echo "\n=== Modified Transfer Spec (diff) ==="
diff $SPEC_FILE $MODIFIED_SPEC_FILE || true
echo "=== End of Diff ===\n"

pause "Execute the modified spec (transfer to $REGISTRY2)"

# ── Step 4: Execute the modified transfer spec ───────────────────────────────

OCM transfer component-version --transfer-spec $MODIFIED_SPEC_FILE --loglevel debug

echo "\nTransfer completed successfully!"

pause "Verify: describe component in $REGISTRY2"

# ── Step 5: Verify the component was transferred to REGISTRY2 ────────────────

OCM describe component-version https://$REGISTRY2//ocm.software/transfer-spec-test:1.0.0

# ── Cleanup ──────────────────────────────────────────────────────────────────

rm -rf $CTF_DIR constructor.yaml $SPEC_FILE $MODIFIED_SPEC_FILE

echo "\nAll done! The component was transferred to $REGISTRY2 using a modified transfer spec."

```

---------

Signed-off-by: Matthias Bruns <git@matthiasbruns.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/chore chore, maintenance, etc. kind/dependency dependency update, etc. size/xs Extra small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants