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: messages are not in correct order #1648

Merged
merged 1 commit into from
Oct 4, 2023

Conversation

kuisathaverat
Copy link
Contributor

Fix #XXX

The message should be and the name of the file are inverted, so when you are not in dry-run mode you see something like :

key "release.version", from file "", /var/folders/rd/../update_channels.jsonupdated from "8.10.0" to "8.10.2"

that should be

key "release.version", from file /var/folders/rd/../update_channels.json, updated from "8.10.0" to "8.10.2"

And in dry-run you see

key "release.version", from file "should be", /var/folders/rd/../update_channels.jsonupdated from "8.10.0" to "8.10.2"

that should be

key "release.version", from file /var/folders/rd/../update_channels.json, should be updated from "8.10.0" to "8.10.2"

Test

To test this pull request, you can run the following commands:

# yaml-language-server: $schema=https://www.updatecli.io/schema/latest/config.json
title: Test JSON file
name: Test JSON file
scms:
  githubConfig:
    kind: "github"
    spec:
      owner: "octocat"
      repository: "octocat.github.io"
      token: '{{ requiredEnv "GITHUB_TOKEN" }}'
      branch: "master"
actions:
  elasticStack:
    kind: github/pullrequest
    scmid: githubConfig
    spec:
      mergemethod: squash
      title: '[updatecli] Test JSON file'
      description: 'Test modification of JSON files.'

sources:
  local:
    kind: shell
    spec:
      command: echo foo
      environments:
        - name: PATH
targets:
  localWithSource:
    name: "Test JSON file"
    scmid: githubConfig
    sourceid: local
    kind: json
    spec:
      file: "params.json"
      key: "name"
  localWithoutSource:
    name: "Test JSON file"
    scmid: githubConfig
    disablesourceinput: true
    kind: json
    spec:
      file: "params.json"
      key: "name"
      value: '{{ source `local` }}'
GITHUB_TOKEN=$(gh auth token) updatecli diff --config test-json.yml

Additional Information

Tradeoff

Potential improvement

Copy link
Member

@lemeurherve lemeurherve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thanks!

Copy link
Contributor

@dduportal dduportal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

@dduportal dduportal added bug Something isn't working target Related to updatecli target resource-json labels Oct 4, 2023
@dduportal dduportal merged commit f8dc7f0 into updatecli:main Oct 4, 2023
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

3 participants