Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: json target when combined with scm #1890

Merged
merged 3 commits into from
Jan 26, 2024
Merged

Conversation

olblak
Copy link
Member

@olblak olblak commented Jan 24, 2024

While investigating #1590 (comment)

I discovered that the json target plugin combined with a scm was broken.
It's scenario difficult to test so I missed when for some reason the plugin stops returning the list of files to commit.

I also took the opportunity to apply the following improvement

  • When updating files, we now show each description, one per line
  • When used with a scm, the log output see the original file and

Test

To test this pull request, I used the following manifest

scms:
  default:
    kind: github
    spec:
      owner: updatecli-test
      repository: kwctl
      branch: main
      token: '{{ requiredEnv "GITHUB_TOKEN"}}'
      username: "olblak"
      user: '{{ requiredEnv "GITHUB_ACTOR"}}'
      email: "me@olblak.com"

sources:
  default:
    kind: jenkins

targets:
  default:
    name: "Update rebaseWhen"
    kind: json
    scmid: default
    spec:
      file: "renovate.json"
# Enable to test that the file was modified
      key: "rebaseWhen"
# Enable to test that the file wasn't modified
#      value: "behind-base-branch"

and

go build -o bin/updatecli .
./bin/updatecli apply --config /tmp/updatecli.yaml --push=false

then I checked in /tmp/updatecli/github/updatecli-test/kwctl/ that I had a commit with the file changed

Additional Information

Tradeoff

Potential improvement

While I am in this plugin, I need to double check the csv plugin and the toml one as they also rely on dasel
Just by looking at the code they seems to be fine

Signed-off-by: Olblak <me@olblak.com>
@olblak olblak added bug Something isn't working target Related to updatecli target resource-json labels Jan 24, 2024
@olblak olblak added this to the 0.72.0 milestone Jan 24, 2024
@olblak olblak changed the title fix: json target fix: json target when combined with scm Jan 24, 2024
@olblak olblak enabled auto-merge (squash) January 26, 2024 08:11
@olblak olblak merged commit d518308 into updatecli:main Jan 26, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working resource-json target Related to updatecli target
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant