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

Merge JSON responses from gh api #8620

Merged
merged 11 commits into from Apr 17, 2024
Merged

Merge JSON responses from gh api #8620

merged 11 commits into from Apr 17, 2024

Conversation

heaths
Copy link
Contributor

@heaths heaths commented Jan 25, 2024

Partly resolves #1268 and replaces #5652. Requires cli/go-gh#148 to be merged and optionally released.

See cli/go-gh#148 for a full discussion.

@heaths
Copy link
Contributor Author

heaths commented Jan 25, 2024

Whoops. Forgot we decided to do this as a new parameter: --paginate-all, IIRC. I'll fix that before I finalize this PR, but figured it still shows how the go-gh work plugs in neatly.

Could we rebase merge this when done? I will keep the commits clean. Might be good to keep the current commit with the necessary logic. Alternatively, I could put in some TODO comments for a future change.

@williammartin
Copy link
Member

Thanks for providing this as an example of how jsonmerge would be called, it was very useful to my understanding. Agree we need --paginate-all or --slurp. Either seems reasonable to me.

Could we rebase merge this when done?

Not sure what the intent is here sorry. I don't understand what rebasing on trunk is getting you, or in the case you mean squash rebase then merge, what that would get you either. I'm just missing something obvious I suspect.

@heaths
Copy link
Contributor Author

heaths commented Jan 27, 2024

The eventual goal after talking with @andyfeller was to deprecate --paginate-all and bake this into --paginate. By rebasing onto trunk and merging - without squashing commits - the changes needed to wire up --paginate are retained; otherwise, I can add a bunch of comments for how it could be done.

More comments will be over on cli/go-gh#148.

@heaths
Copy link
Contributor Author

heaths commented Jan 31, 2024

@williammartin I ran into an issue when porting some of my old tests from #5652 that would be better served by bifurcating the logic. I will try to work around it given our discussion in cli/go-gh#148, but the problem is basically that the existing code only merges if there's no template; however, that ends up executing the template for each page, so the table alignment from {{tablerow}} I added a while back doesn't work.

Consider two pages:

[{"id":1,"title":"one"}]
[{"id":20,"title":"twenty"}]

It should render as:

1   one
20  twenty

However, because the template is executed for each page, that first page width is 1 less character:

1  one
20  twenty

Because of the refactoring I made in #5652 it actually worked correctly. The template execution happened later after merging was complete. And this worked for both REST and GraphQL responses because either were cached until the last page was read and merged. Because Nate's solution for REST responses no longer caches - which I've maintained here for reasons we discussed in #5652 - I could only do this for GraphQL responses currently.

Assuming I can work around this - and I'm updating status here in case I don't finish tonight, but I'll push what I have with that one test disabled for now - the future refactoring should take this into account.

UPDATE: I was able to work around this. Actually, it was because my old test intentionally added {{tablerender}} to make sure that arrays - even within objects - were first merged. The misalignment happens even with the current gh release, so this isn't a regression. I restored the test to what it was, which will render the template as a whole once flushed at the very end of apiRun. Still, what I suggested above is appropriate: if we were to refactor this, we'd still want to ideally merge REST arrays - or at least GraphQL objects - before passing to a template or filter. At that point, we no longer need to merge only if no --template option was passed. All that should still technically work, and work better because we template the merged pages, so rows would be aligned regardless of the presence of an explicit {{tablerender}}.

@heaths
Copy link
Contributor Author

heaths commented Jan 31, 2024

Given further discussions about stability, @andyfeller @williammartin do we still want to add --paginate-all? I'm working on the changes now, and it certainly increases the complexity of several conditions. It's not that it's complicated to implement, but I worry has negative ramifications to users' experience...at least in error cases.

UPDATE: Thinking about this more, maybe we should consider a --slurp in addition to --paginate i.e., both are required. @andyfeller, Sam, and I discussed this late last year, but I believe the reason we opted for --paginate-all because the parameters are sorted and this would put --paginate-all right after --paginate whereas --slurp would come after --silent several parameters down. Perhaps --merge would at least be closer, and I think would make both the user experience and maintenance easier because we don't have to distinguish between --paginate and --paginate-all in some cases but not others.

Still, marking the PR ready. I updated everything per discussions, but I'm open to changing a few things as suggested above.

@heaths heaths marked this pull request as ready for review January 31, 2024 09:34
@heaths heaths requested a review from a team as a code owner January 31, 2024 09:34
@heaths heaths requested review from andyfeller and removed request for a team January 31, 2024 09:34
@cliAutomation cliAutomation added the external pull request originating outside of the CLI core team label Jan 31, 2024
@cliAutomation cliAutomation added this to Needs review 🤔 in The GitHub CLI Jan 31, 2024
@williammartin
Copy link
Member

Because of the two comments that were also later updated I'm not sure how much of them is still considered relevant, so excuse me if these questions seem to have obvious answers.

Given further discussions about stability, @andyfeller @williammartin do we still want to add --paginate-all?

I don't understand your question. Are you talking about the flag, or the behaviour?

It's not that it's complicated to implement, but I worry has negative ramifications to users' experience...at least in error cases.

What error cases?

Thinking about this more, maybe we should consider a --slurp in addition to --paginate i.e., both are required.

I don't really have a strong opinion but I'm also not really following why you would prefer --slurp or --merge to --paginate-all. What's your take? If you asked me to flip a coin I would say --slurp as additive to --paginate.

Re: all the --template stuff, I'll have to dig a little more.

Thanks!

@heaths
Copy link
Contributor Author

heaths commented Jan 31, 2024

--paginate and --paginate-all are mutually exclusive. That means all errors when you specified --paginate e.g., with --input have to be updated to mention both of them. For code maintenance, in most cases I have to check either ApiOptions.Paginate or ApiOptions.PaginateAll (made a simple helper for leaner code in those cases) but in other cases (one, used as a proxy and henceforth the presence of a Merger is used) just check ApiOptions.PaginateAll. If we used - hopefully just temporarily - a separate option like --slurp or --merge (personally, I feel "slurp" probably won't be well-understood by most where "merge" should be easier to understand) in addition to --paginate, I think the usage and code are simplified. Want merged results as a user? Pass --merge. Want to know if we should page and merge? Check ApiOptions.Merge in addition to existing checks against ApiOptions.Paginate.

The discussion @andyfeller, Sam, and I had back in December was that this would be temporary until we see enough usage of merged pagination without regressions - even though I think, with the addition of more tests I added, we have a good battery of tests. I appreciate the emphasis on backward compatibility where it makes sense to.

@williammartin
Copy link
Member

Understood. The only reason I leaned slightly towards --slurp is because merge is an overloaded term. --merge-pages could be a compromise. If we went with --merge I wouldn’t put up any kind of fight though, it's not maddeningly confusing given the context.

The discussion @andyfeller, Sam, and I had back in December was that this would be temporary until we see enough usage of merged pagination without regressions

To be specific, the follow up notes from the call target this behavioural change for a major version:

When we consider future 3.0 plans, that might be a good time to make this the default behavior

I’m sure this is clear to you already but for the sake of posterity for anyone reading this in the future, the issue at hand is that any user depending on interrogating the output of something like:

gh api graphql --paginate -f query='
    query($endCursor: String) {
      viewer {
        repositories(first: 100, after: $endCursor) {
          nodes { nameWithOwner }
          pageInfo {
            hasNextPage
            endCursor
          }
        }
      }
    }
  '

might be broken by changing --paginate to work like --paginate-all. I’m not sure of any reasonable way we could be sure we aren’t breaking any users here. On the other hand, as Linus says:

The "no regressions" rule is not about made-up "if I do this, behavior changes".

The "no regressions" rule is about users.

If you have an actual user that has been doing insane things, and we
change something, and now the insane thing no longer works, at that
point it's a regression, and we'll sigh, and go "Users are insane" and
have to fix it.

Not that our users would be insane for this but that if a CLI regresses and no one is around to notice it, did it really regress.

@heaths
Copy link
Contributor Author

heaths commented Jan 31, 2024

might be broken by changing --paginate to work like --paginate-all

Possibly, but that seems incredibly unlikely. The CLI would emit multiple pages like so:

{
  "data": {
    "viewer": {
      "repositories": {
        "nodes": [{"nameWithOwner": "heaths/cli"}]
      }
    }
  }
}
{
  "data": {
    "viewer": {
      "repositories": {
        "nodes": [{"nameWithOwner": "heaths/cli"}]
      }
    }
  }
}

Currently, that's invalid JSON. You can't pass it to jq or PowerShell's ConvertFrom-Json, for example. At least jq has a --slurp option, but you'd have to understand what that even means whereas --merge-pages is pretty intuitive.

Now, lets say that someone wrote a script (as I did before starting the original work) that looks for }{ with or without line breaks so that they could parse those pages separately. Such a script wouldn't be broken by the lack of a match now. And if that script further sent each page through to another tool that parsed JSON, that wouldn't be broken either by a single page.

That said, and re:

To be specific, the #1268 (comment) from the call target this behavioural change for a major version:

Thank you. I had forgotten not only that part of the discussion about the next major version but didn't realize or forgot we wrote down meeting notes in the issue. That does make sense, and while I think the risk of regression is slim to none, I agree it makes sense to wait to truly fix this in v3.

The only reason I leaned slightly towards --slurp is because merge is an overloaded term. --merge-pages could be a compromise.

I like --merge-pages. --merge is vague, you're right, though I think it's still better than --slurp which is probably only understood by those that know jq. In the vernacular, it means, "eat or drink (something) with a loud sloppy sucking noise". Why jq chose it I don't know, but I'm a fan of keeping things as obvious as possible without being..."cute". (Don't get me started on Rusts "yeet"! 😉)

@williammartin
Copy link
Member

williammartin commented Jan 31, 2024

Currently, that's invalid JSON. You can't pass it to jq

I was surprised to find that at least on my machine jq actually is happy to query over multiple documents e.g. the query 'jq .data.viewer.repositories.nodes[].nameWithOwner' will return both namesWithOwner. However, after that things start get out of hand...try this one on for style with your example above:

jq -n 'reduce inputs as $i (""; . + " " + $i.data.viewer.repositories.nodes[].nameWithOwner)'

jq will actually allow you to use the provided documents as an array which opens up a world of madness that ends up with different behaviours between --paginate and --paginate-all output. My point isn't that this is a sensible thing to do (and any realistic example should learn to handle the array in each document correctly) just that I find it very hard to imagine the way in which things might break even just through usage of jq. We seem to be struggling with breaking things we should know about as it is 😅

That does make sense, and while I think the risk of regression is slim to none, I agree it makes sense to wait to truly fix this in v3.

I also think that most likely regressions are unlikely and it's actually likely that most regressions would have been indicative of a buggy script but I think waiting till v3 is the safest option.

but I'm a fan of keeping things as obvious as possible without being..."cute".

--merge-pages is my top choice at the moment, though probably worth @andyfeller weighing in.

Don't get me started on Rusts "yeet"! 😉

I've given enough projects terrible names in my time to keep my mouth zipped 😬

@williammartin
Copy link
Member

image

Me, reading the jq docs.

@heaths
Copy link
Contributor Author

heaths commented Jan 31, 2024

I'll rename the switch and rejigger a bit of the logic and let you know. Probably tonight. Looks like I need to rebase again, but at least this has been clean so far unlike my first PR for this issue.

BTW, sorry for updating comments previously. I've typically done this when I expect the person is either 1) further away with a large offset in time zone, or 2) is close to me, but I'm active at a time later than they would usually be. It's the whole chunky vs. chatty discussion dilemma. While it may not have helped in this case (since I was up late and all I can glean from your profile is that you at least visited the Golden Gate bridge at some point), I did file a feature request: https://github.com/orgs/community/discussions/102931

I find the TZ offset in Teams to help communicating with partner teams to help decide if I should having a chunky reply or expect a chatty back-and-forth.

@heaths
Copy link
Contributor Author

heaths commented Jan 31, 2024

Me, reading the jq docs.

I frequently have to switch tools - and always have to refer back to docs - that use either jq syntax, JSONPath, or JMESPath. All similar but different enough it's a nightmare to keep straight which does what and how.

@williammartin
Copy link
Member

Ah well for future reference I'm in Amsterdam, NL and I've updated my profile to reflect that. Not a problem with the updates.

@heaths
Copy link
Contributor Author

heaths commented Feb 2, 2024

@williammartin this should be ready now. I removed the "experimental" notes given this is an additional flag that still requires --paginate, but feel free, of course, to update the text if you'd like, assuming no other changes you'd like.

@heaths heaths marked this pull request as draft February 2, 2024 05:09
@heaths
Copy link
Contributor Author

heaths commented Feb 2, 2024

Wait: something is wrong. Tests pass, but I just tried it in a use case and it still emits separate pages and a final blank {}. This worked previously. 😕 Debugging...

@heaths heaths marked this pull request as ready for review February 2, 2024 05:35
@heaths
Copy link
Contributor Author

heaths commented Feb 2, 2024

@williammartin I realized the problem: I forgot, to maintain backcompat, this only works when piping or redirecting stdout. When I was testing it, I was just printing to the terminal. Still, that showed me that objectMerger.Close had to be conditional - at least, that was the easiest way to deal with it. Added a test as well.

To note, jq worked for you before because it doesn't seem to care if there are multiple top-level objects or arrays and still formats them as such. --slurp just means it merged those objects or arrays before formatting. Effectively, gh api --merge-pages now works like jq --slurp. I noticed - and further tested this - when debugging this last problem since I remembered you saying it already seemed to work for you. It wouldn't have worked with less...permissive...processes further down the pipe e.g., ConvertFrom-Json in PowerShell (which is what we are using in our scripts that originally put me on this path).

For a future v3, there's definitely a lot of room for improvement. For example, I think the merging behavior should be default but, IMO, I would use mergo for both JSON arrays and objects like #5652 did. Not only is it straight forward, but I see little value in "streaming" each page given the typical use cases. I fully appreciate that's a risk you're not willing to take now for v2. I could see this diverging down separate code paths depending on the presence of graphql (or maybe that convention even changes) but in both code paths JSON is merged into a top-level array or object based on the first page like I did here: https://github.com/heaths/cli/blob/1a7f803241123d36c9ce1ab3893b498fe1d71e89/pkg/cmd/api/pagination.go#L129-L140. This then works for a top-level array or object from REST. And for GraphQL, you wouldn't actually need to tee the response body to later find the cursor since you already have the merge buffer i.e., just a single buffer is needed. Just some thoughts for posterity.

@heaths
Copy link
Contributor Author

heaths commented Feb 2, 2024

PS: seems the pr-auto bot doesn't like it when a PR is readied again: says the PR is already linked to a project. It's not required, but just wanted to point that out since I took a peek as to why it failed.

@heaths
Copy link
Contributor Author

heaths commented Mar 19, 2024

Just need to address the trailing ] I think.

Any idea why I can't page when running go run ./cmd/gh ...? I've debugged through it. Everything should be working. I've exported PAGER as well as setting it on the command line e.g., PAGER=less go run ./cmd/gh .... Not asking you to debug into it or anything, but wondering if you've had any similar experience or some idea. I've been trying a couple different things to no avail.

@heaths
Copy link
Contributor Author

heaths commented Mar 19, 2024

Not that I don't believe you...just so I can repro it and fix it. Still trying to think how without getting "too creative" e.g., using a list of funcs to which I can add differs (I often use a similar "trick" in complex PowerShell scripts).

@williammartin
Copy link
Member

Any idea why I can't page when running go run ./cmd/gh ...?

Not sure, it seems to work for me on whatever set up I have on mac. I can't think of any reason go run would act differently, I thought it just compiled the binary to a temp dir and ran it.

What's your set up? Maybe I can try and repro in my Windows VM.

@heaths
Copy link
Contributor Author

heaths commented Mar 19, 2024

What's your set up? Maybe I can try and repro in my Windows VM.

I'm actually doing this on a pure Ubuntu box (and even on Windows I use WSL). With quick-and-dirty println debugging, I've confirmed the env var is definitely getting plumbed through. Let me try a few other things, like do the same test running against main. While it seems none of my changes should make a difference, maybe somehow they did. The only thing that comes to mind is moving where the output streams are declared and possibly initialized, but I reviewed that before and it seems unlikely.

@andyfeller
Copy link
Contributor

andyfeller commented Apr 2, 2024

@heaths : handful of questions for you:

  1. How are you accounting for all of the various ways that paging is configured?

    From how I read the code below, there are several things that affect paging with PAGER being the lowest precedence.

  2. How does this compare when compiled versus go run?

    Normally I wouldn't assume this is a factor but worth comparing.

  3. How does this compare with and without explicit piping?

    I think this was a question that @williammartin raised earlier, unsure if this yielded any results.

    If you pipe the output through jq - which will require valid JSON - does it work?

    Yes, but I would expect that since the pager only starts if connected to a TTY.

I'm going to try testing this on a variety of physical devices to see if I can't reproduce.

func ioStreams(f *cmdutil.Factory) *iostreams.IOStreams {
io := iostreams.System()
cfg, err := f.Config()
if err != nil {
return io
}
if _, ghPromptDisabled := os.LookupEnv("GH_PROMPT_DISABLED"); ghPromptDisabled {
io.SetNeverPrompt(true)
} else if prompt := cfg.Prompt(""); prompt == "disabled" {
io.SetNeverPrompt(true)
}
// Pager precedence
// 1. GH_PAGER
// 2. pager from config
// 3. PAGER
if ghPager, ghPagerExists := os.LookupEnv("GH_PAGER"); ghPagerExists {
io.SetPager(ghPager)
} else if pager := cfg.Pager(""); pager != "" {
io.SetPager(pager)
}
return io
}

@andyfeller
Copy link
Contributor

andyfeller commented Apr 2, 2024

Just reaffirming what @williammartin reported above, I see the hanging ] using go1.21.8 on MacOS and running the following:

make

QUERY='                                                                
query($endCursor: String) {
    viewer {
        repositories(first: 10, after: $endCursor) {
            nodes { nameWithOwner, isFork }
            pageInfo {
                hasNextPage
                endCursor
            }
        }
    }
}
'

GH_PAGER=less ./bin/gh api graphql --paginate --slurp -f query="$QUERY"

this results in the hanging ] outside of less:

andyfeller@Andys-MBP:cli/cli ‹merge-json›$ GH_PAGER=less ./bin/gh api graphql --paginate --slurp -f query="$QUERY"
]
andyfeller@Andys-MBP:cli/cli ‹merge-json›$

the same result even running it via go run:

andyfeller@Andys-MBP:cli/cli ‹merge-json›$ GH_PAGER=less go run ./cmd/gh/main.go api graphql --paginate --slurp -f query="$QUERY" 
]
andyfeller@Andys-MBP:cli/cli ‹merge-json›$ 

@andyfeller
Copy link
Contributor

andyfeller commented Apr 2, 2024

Doing testing on physical Windows 10 laptop in Git Bash with go1.21.7, I do notice that Windows behaves differently:

  1. GH_PAGER=less does not show slurped data in alternative mode like Mac + Zsh
  2. GH_PAGER=more has a notable difference in the closing ] than less as there is a separation reminiscent of Mac testing of ] coming after the pager is closed

I was digging into how gh detects if the terminal has support for alternative mode and trying to force that to showcase the problem on Windows, however setting TERM and/or COLORTERM to truecolor wasn't enough to trick it from printing the JSON to stdout.

andre@DESKTOP-A5BGD8P MINGW64 ~/Documents/cli/cli (ggm-issue-8677-tinker)
$ gh pr list --author heaths

Showing 1 of 1 pull request in cli/cli that matches your search

ID     TITLE                               BRANCH             CREATED AT
#8620  Merge JSON responses from `gh api`  heaths:merge-json  about 2 months ago

andre@DESKTOP-A5BGD8P MINGW64 ~/Documents/cli/cli (ggm-issue-8677-tinker)
$ gh pr checkout 8620
From https://github.com/cli/cli
 * [new ref]           refs/pull/8620/head -> merge-json
Switched to branch 'merge-json'

andre@DESKTOP-A5BGD8P MINGW64 ~/Documents/cli/cli (merge-json)
$ make
go build -o script/build.exe script/build.go
go build -trimpath -ldflags "-X github.com/cli/cli/v2/internal/build.Date=2024-04-02 -X github.com/cli/cli/v2/internal/build.Version=v2.45.0-13-gf276971b " -o bin/gh.exe ./cmd/gh
go: downloading github.com/cli/go-gh/v2 v2.6.0

andre@DESKTOP-A5BGD8P MINGW64 ~/Documents/cli/cli (merge-json)
$ QUERY='
query($endCursor: String) {
    viewer {
        repositories(first: 100, after: $endCursor) {
            nodes { nameWithOwner, isFork }
            pageInfo {
                hasNextPage
                endCursor
            }
        }
    }
}
'

andre@DESKTOP-A5BGD8P MINGW64 ~/Documents/cli/cli (merge-json)
$ GH_PAGER=less ./bin/gh.exe api graphql --paginate --slurp -f query="$QUERY"
[
  {
    "data": {
      "viewer": {
        "repositories": {
          "nodes": [
            {
              "nameWithOwner": "community/maintainers",
              "isFork": false
            },
            {
              "nameWithOwner": "githubtraining/training-manual",
              "isFork": false
            },
            {
              "nameWithOwner": "andyfeller/docker-alpine-abuild",
              "isFork": true
            },
            {
              "nameWithOwner": "andyfeller/docker.github.io",
              "isFork": true
            },
            ...
          ],
          "pageInfo": {
            "hasNextPage": false,
            "endCursor": "Y3Vyc29yOnYyOpHOLl0I8w=="
          }
        }
      }
    }
  }
]

andre@DESKTOP-A5BGD8P MINGW64 ~/Documents/cli/cli (merge-json)
$ GH_PAGER=more ./bin/gh.exe api graphql --paginate --slurp -f query="$QUERY"
[
  {
    "data": {
      "viewer": {
        "repositories": {
          "nodes": [
            {
              "nameWithOwner": "community/maintainers",
              "isFork": false
            },
            {
              "nameWithOwner": "githubtraining/training-manual",
              "isFork": false
            },
            {
              "nameWithOwner": "andyfeller/docker-alpine-abuild",
              "isFork": true
            },
            {
              "nameWithOwner": "andyfeller/docker.github.io",
              "isFork": true
            },
            ...
          ],
          "pageInfo": {
            "hasNextPage": false,
            "endCursor": "Y3Vyc29yOnYyOpHOLl0I8w=="
          }
        }
      }
    }
  }

]

andre@DESKTOP-A5BGD8P MINGW64 ~/Documents/cli/cli (merge-json)
$

@heaths
Copy link
Contributor Author

heaths commented Apr 2, 2024

Thanks. I'm not testing this in Windows, though. I'm in WSL, which is a linux kernel and binaries. I'm also not seeing it in my Ubuntu-on-bare-metal laptop. I don't deny it exists, but hard to verify a fix if I can't reproduce it.

That said, the reason why it happens is well-understood. I will try to come up with an alternative approach, but I have so little time these past few weeks and this coming week or two.

@williammartin
Copy link
Member

These most recent changes resolve the paging issue for me!

Snippet from my paging output:

...
         ],
          "pageInfo": {
            "hasNextPage": false,
            "endCursor": "Y3Vyc29yOnYyOpHOLpRgvg=="
          }
        }
      }
    }
  }
]

Copy link
Contributor

@andyfeller andyfeller left a comment

Choose a reason for hiding this comment

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

From what I can gather, I think this is solid and will follow up with @williammartin for final review.

Copy link
Member

@williammartin williammartin left a comment

Choose a reason for hiding this comment

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

Getting so close 😅

pkg/cmd/api/api.go Outdated Show resolved Hide resolved
@@ -233,6 +270,7 @@ func NewCmdApi(f *cmdutil.Factory, runF func(*ApiOptions) error) *cobra.Command
cmd.Flags().StringArrayVarP(&opts.RequestHeaders, "header", "H", nil, "Add a HTTP request header in `key:value` format")
cmd.Flags().StringSliceVarP(&opts.Previews, "preview", "p", nil, "GitHub API preview `names` to request (without the \"-preview\" suffix)")
cmd.Flags().BoolVarP(&opts.ShowResponseHeaders, "include", "i", false, "Include HTTP response status line and headers in the output")
cmd.Flags().BoolVar(&opts.Slurp, "slurp", false, "Use with \"--paginate\" to return an array of all pages of either JSON arrays or objects")
Copy link
Member

Choose a reason for hiding this comment

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

Sorry @heaths, one of the issues with long running PRs like this is remembering all the context. When I played around with this just now I anticipated that for REST endpoints --paginate --slurp would be the same as --paginate since the content of REST responses already get slurped into an array. However what happens is we end up doubly nesting the array:

[
  [
    {
      "url": "https://api.github.com/repos/cli/cli/releases/149628351",
...
    }
  ]
]

Maybe my assumption is bad and we always want to apply the same semantics to --slurp even if it produces a strange result - we already know that the whole pagination is kind of quirky. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That was how it originally worked, but then someone noted it didn't "solve" their problem of merging nested arrays - only top-level arrays. I still think that's up to business logic - there's no way for us to know which level of arrays to merge - but in the discussion above I agreed to just wrap everything in an array like jq --slurp so that we at least return valid JSON. That's all this PR has ever been about: returning valid JSON such that you can pipe it to something that requires it - not jq, but something like PowerShell's ConvertFrom-Json.

Copy link
Member

Choose a reason for hiding this comment

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

I remember that discussion as it related to the GQL requests and I agree that we cannot know that and the consumer needs to determine that themselves.

To be clear, here I'm describing the existing merging of JSON array REST responses already getting slurped by --paginate with no further work (as far as I can tell). Below in the screenshot you can see the difference between ./bin/gh api --paginate repos/cli/go-gh/release and ./bin/gh api --paginate --slurp repos/cli/go-gh/release. The --slurp results in a double nesting of arrays with the top level one only having one item.

It's just a bit of a weird situation that the REST pagination ends up creating a single array object that the slurp then wraps in another array. I'm not sure there is a good solution to this though, except perhaps only allowing --slurp on graphql paginated requests? In any case someone is liable to get confused, so maybe we just ship this and move on with our lives.

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, that was the compromised we discussed in our meeting with @andyfeller as well: we'd mimic jq --slurp exactly, which also double-nests arrays. This way, the result is consistent: it's always an array. The array items are each page of the response regardless of whether it's an array or object. No guesswork as to how best to handle the output: it's always an array of each page. If you don't need that for a REST response of arrays, don't pass --slurp: you'll already get a merged array because of Nate's previous change based on my old PR.

I'd rather have consistency than conditional output formats myself. Easier to code without having to think of whether I'm making a REST call or GraphQL call.

Copy link
Member

@williammartin williammartin left a comment

Choose a reason for hiding this comment

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

Thanks for all your hard work here @heaths, I know it has been a long and painful process.

@williammartin williammartin merged commit fd4f2c9 into cli:trunk Apr 17, 2024
9 checks passed
@heaths heaths deleted the merge-json branch April 17, 2024 16:35
renovate bot added a commit to scottames/dots that referenced this pull request Apr 19, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [aquaproj/aqua-registry](https://togithub.com/aquaproj/aqua-registry)
| minor | `v4.160.0` -> `v4.163.0` |
| [cli/cli](https://togithub.com/cli/cli) | minor | `v2.47.0` ->
`v2.48.0` |
| [eza-community/eza](https://togithub.com/eza-community/eza) | patch |
`v0.18.10` -> `v0.18.11` |
|
[gruntwork-io/terragrunt](https://togithub.com/gruntwork-io/terragrunt)
| minor | `v0.56.5` -> `v0.57.5` |
| [junegunn/fzf](https://togithub.com/junegunn/fzf) | minor | `0.49.0`
-> `0.50.0` |
| [kubernetes/kubectl](https://togithub.com/kubernetes/kubectl) | minor
| `1.29.3` -> `1.30.0` |
| [snyk/cli](https://togithub.com/snyk/cli) | minor | `v1.1288.0` ->
`v1.1290.0` |
| [twpayne/chezmoi](https://togithub.com/twpayne/chezmoi) | patch |
`v2.47.3` -> `v2.47.4` |
| [zellij-org/zellij](https://togithub.com/zellij-org/zellij) | minor |
`v0.39.2` -> `v0.40.0` |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>aquaproj/aqua-registry (aquaproj/aqua-registry)</summary>

###
[`v4.163.0`](https://togithub.com/aquaproj/aqua-registry/releases/tag/v4.163.0)

[Compare
Source](https://togithub.com/aquaproj/aqua-registry/compare/v4.162.0...v4.163.0)


[Issues](https://togithub.com/aquaproj/aqua-registry/issues?q=is%3Aissue+milestone%3Av4.163.0)
| [Pull
Requests](https://togithub.com/aquaproj/aqua-registry/pulls?q=is%3Apr+milestone%3Av4.163.0)
| aquaproj/aqua-registry@v4.162.0...v4.163.0

##### 🎉 New Packages


[#&#8203;21951](https://togithub.com/aquaproj/aqua-registry/issues/21951)
[gittuf/gittuf](https://togithub.com/gittuf/gittuf): A security layer
for Git repositories

[#&#8203;21955](https://togithub.com/aquaproj/aqua-registry/issues/21955)
[pipe-cd/pipecd/pipectl](https://pipecd.dev/docs-v0.47.x/user-guide/command-line-tool/):
The command line tool for PipeCD
[@&#8203;ponkio-o](https://togithub.com/ponkio-o)

[#&#8203;21955](https://togithub.com/aquaproj/aqua-registry/issues/21955)
[pipe-cd/pipecd/piped](https://pipecd.dev/docs-v0.47.x/concepts/#piped):
A component of PipeCD that runs inside target environment to execute
deployment and report its state
[@&#8203;ponkio-o](https://togithub.com/ponkio-o)

[#&#8203;21957](https://togithub.com/aquaproj/aqua-registry/issues/21957)
[mashiike/redshift-credentials](https://togithub.com/mashiike/redshift-credentials):
a command line tool for Amazon Redshift temporary authorization with AWS
IAM [@&#8203;mashiike](https://togithub.com/mashiike)

##### 🎉 New Contributors

Thank you for your contribution!

[@&#8203;mashiike](https://togithub.com/mashiike)
[#&#8203;21957](https://togithub.com/aquaproj/aqua-registry/issues/21957)

###
[`v4.162.0`](https://togithub.com/aquaproj/aqua-registry/releases/tag/v4.162.0)

[Compare
Source](https://togithub.com/aquaproj/aqua-registry/compare/v4.161.0...v4.162.0)


[Issues](https://togithub.com/aquaproj/aqua-registry/issues?q=is%3Aissue+milestone%3Av4.162.0)
| [Pull
Requests](https://togithub.com/aquaproj/aqua-registry/pulls?q=is%3Apr+milestone%3Av4.162.0)
| aquaproj/aqua-registry@v4.161.0...v4.162.0

##### 🎉 New Packages


[#&#8203;21900](https://togithub.com/aquaproj/aqua-registry/issues/21900)
[kubecolor/kubecolor](https://togithub.com/kubecolor/kubecolor):
Colorize your kubectl output

##### Fixes


[#&#8203;21903](https://togithub.com/aquaproj/aqua-registry/issues/21903)
charmbracelet/vhs: Follow up changes of vhs v0.7.2

[#&#8203;21902](https://togithub.com/aquaproj/aqua-registry/issues/21902)
extrawurst/gitui: Follow up changes of gitui v0.26.1

[#&#8203;21892](https://togithub.com/aquaproj/aqua-registry/issues/21892)
mjibson/sqlfmt: Rename the package to maddyblue/sqlfmt

[#&#8203;21846](https://togithub.com/aquaproj/aqua-registry/issues/21846)
vmware/govmomi/govc: Regenerate the setting

###
[`v4.161.0`](https://togithub.com/aquaproj/aqua-registry/releases/tag/v4.161.0)

[Compare
Source](https://togithub.com/aquaproj/aqua-registry/compare/v4.160.0...v4.161.0)


[Issues](https://togithub.com/aquaproj/aqua-registry/issues?q=is%3Aissue+milestone%3Av4.161.0)
| [Pull
Requests](https://togithub.com/aquaproj/aqua-registry/pulls?q=is%3Apr+milestone%3Av4.161.0)
| aquaproj/aqua-registry@v4.160.0...v4.161.0

##### 🎉 New Packages


[#&#8203;21832](https://togithub.com/aquaproj/aqua-registry/issues/21832)
[tgenv/tgenv](https://togithub.com/tgenv/tgenv): A tool to manage
multiples Terragrunt versions
[@&#8203;bhundven](https://togithub.com/bhundven)

##### Fixes


[#&#8203;21834](https://togithub.com/aquaproj/aqua-registry/issues/21834)
mashiike/prepalert: Follow up changes of prepalert v1.0.2

A checksum file was renamed.


mashiike/prepalert@493b8ae

##### 🎉 New Contributors

Thank you for your contribution!

[@&#8203;bhundven](https://togithub.com/bhundven)
[#&#8203;21832](https://togithub.com/aquaproj/aqua-registry/issues/21832)

</details>

<details>
<summary>cli/cli (cli/cli)</summary>

### [`v2.48.0`](https://togithub.com/cli/cli/releases/tag/v2.48.0):
GitHub CLI 2.48.0

[Compare Source](https://togithub.com/cli/cli/compare/v2.47.0...v2.48.0)

#### The Big Stuff

- Added support for `--slurp`ing JSON responses in `gh api` by
[@&#8203;heaths](https://togithub.com/heaths) in
[cli/cli#8620
- Added `--skip-ssh-key` option to `gh auth login` command by
[@&#8203;babakks](https://togithub.com/babakks) in
[cli/cli#8935
- Added `numSelectedRepos` to JSON output of `gh secret list` by
[@&#8203;babakks](https://togithub.com/babakks) in
[cli/cli#8899
- Added support for multiple items in `gh api` nested array by
[@&#8203;Ebonsignori](https://togithub.com/Ebonsignori) in
[cli/cli#8762
- Fixed panic when running `gh repo rename` by
[@&#8203;babakks](https://togithub.com/babakks) in
[cli/cli#8906
- Fixed panic when parsing IPv6 remote URLs by
[@&#8203;babakks](https://togithub.com/babakks) in
[cli/cli#8893
- Fixed `gh pr lock/unlock` not working when URL is passed by
[@&#8203;t4kamura](https://togithub.com/t4kamura) in
[cli/cli#8837
- Fixed viewing run logs with filenames that the regex didn't handle
[@&#8203;zdrve](https://togithub.com/zdrve) in
[cli/cli#8882

#### The Rest

- Tidy `go.mod` by
[@&#8203;matthewhughes934](https://togithub.com/matthewhughes934) in
[cli/cli#8958
- Fix cache contention in Go CI jobs by
[@&#8203;matthewhughes934](https://togithub.com/matthewhughes934) in
[cli/cli#8957
- Fix `go` directive in `go.mod` by
[@&#8203;matthewhughes934](https://togithub.com/matthewhughes934) in
[cli/cli#8956
- Update install_linux.md by
[@&#8203;richterdavid](https://togithub.com/richterdavid) in
[cli/cli#8950
- build(deps): bump google.golang.org/grpc from 1.61.1 to 1.61.2 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[cli/cli#8925
- Add codeowners entry for the GitHub TUF root included in the
`attestation` command set by
[@&#8203;malancas](https://togithub.com/malancas) in
[cli/cli#8919
- Create stronger run log cache abstraction by
[@&#8203;williammartin](https://togithub.com/williammartin) in
[cli/cli#8931
- Remove naked returns from git ParseURL by
[@&#8203;williammartin](https://togithub.com/williammartin) in
[cli/cli#8929
- Fix api cache test by
[@&#8203;williammartin](https://togithub.com/williammartin) in
[cli/cli#8932
- Ensure run log cache creates cache dir if it doesn't exist by
[@&#8203;williammartin](https://togithub.com/williammartin) in
[cli/cli#8944
- Close zip file in run view tests by
[@&#8203;williammartin](https://togithub.com/williammartin) in
[cli/cli#8945
- Fix `attestation` cmd offline unit test failure by
[@&#8203;malancas](https://togithub.com/malancas) in
[cli/cli#8933
- Add support to `attestation` command for more predicate types. by
[@&#8203;steiza](https://togithub.com/steiza) in
[cli/cli#8949

#### New Contributors

- [@&#8203;babakks](https://togithub.com/babakks) made their first
contribution in
[cli/cli#8906
- [@&#8203;t4kamura](https://togithub.com/t4kamura) made their first
contribution in
[cli/cli#8837
- [@&#8203;zdrve](https://togithub.com/zdrve) made their first
contribution in
[cli/cli#8882
- [@&#8203;Ebonsignori](https://togithub.com/Ebonsignori) made their
first contribution in
[cli/cli#8762
- [@&#8203;matthewhughes934](https://togithub.com/matthewhughes934) made
their first contribution in
[cli/cli#8958
- [@&#8203;richterdavid](https://togithub.com/richterdavid) made their
first contribution in
[cli/cli#8950

**Full Changelog**: cli/cli@v2.47.0...v2.48.0

</details>

<details>
<summary>eza-community/eza (eza-community/eza)</summary>

###
[`v0.18.11`](https://togithub.com/eza-community/eza/releases/tag/v0.18.11):
eza v0.18.11

[Compare
Source](https://togithub.com/eza-community/eza/compare/v0.18.10...v0.18.11)

### Note to BSD users

We recently added support for freebsd, netbsd, and openbsd. However, we
don't seem to have any regular contributors that use these platforms.
Last week, that meant netbsd build being broken (which was later fixed),
this week, it means freebsd is.

If you're a user of any of these, and wanna help us support these
platforms, please consider joining our matrix rooms and introduce
yourself.

### Changelog

#### \[0.18.11] - 2024-04-19

##### Bug Fixes

-   Fix clippy lints
-   Enable the rule only for NetBSD.
-   Build aarch64, arm without libgit2

##### Miscellaneous Tasks

-   Release eza v0.18.11

##### Ci

-   Bump NetBSD version to 10.0

### Checksums

#### sha256sum

0ca2fdbfde90eb209e0e79b26052ed0087f89ab7c4f7a28b7ef28425ac9c2cc5
./target/bin-0.18.11/eza_aarch64-unknown-linux-gnu.tar.gz
53e98fd2fece242206b9b82141c0c8f3d1a1d681aa0be1ce504353ef1e7f9d9e
./target/bin-0.18.11/eza_aarch64-unknown-linux-gnu.zip
312b8424ddd4839f9fd1afbb8d47ab2da5e60d6aa1eef0336d7b5a23cb0f467a
./target/bin-0.18.11/eza_arm-unknown-linux-gnueabihf.tar.gz
3f2387b2d7a5a51d4a592a0ba5e22dcb4181be11ca18964945d00990f9e67f33
./target/bin-0.18.11/eza_arm-unknown-linux-gnueabihf.zip
5f89f4b3a2ac8c5072c9fdbb928546768a67ab1f7ca1de61d25920d9c08eab9e
./target/bin-0.18.11/eza.exe_x86_64-pc-windows-gnu.tar.gz
deb6484d38f5080feb152fb6d6b39fef7e198784fa43abc362160ee4b64a8f0e
./target/bin-0.18.11/eza.exe_x86_64-pc-windows-gnu.zip
223e0b5e1708e83304a4143f6ad18411177f8e377afbf62d7c12f34a24d5e2b9
./target/bin-0.18.11/eza_x86_64-unknown-linux-gnu.tar.gz
49b3e7efb0f35e209324c46eb680c47613fad3de3caf4c039323068a2624d70f
./target/bin-0.18.11/eza_x86_64-unknown-linux-gnu.zip
76897bfeb00e17dffb9d4bc0a72351568461eeccbcb4b490fa1dab7a7941528a
./target/bin-0.18.11/eza_x86_64-unknown-linux-musl.tar.gz
eabae039a540fca6045af4689fff4e9c09e85f257eb96d3bcbd2801a15326a60
./target/bin-0.18.11/eza_x86_64-unknown-linux-musl.zip

#### md5sum

ae10158f7ecc52140fb7ab24d67951e5
./target/bin-0.18.11/eza_aarch64-unknown-linux-gnu.tar.gz
dd1de5d7a97010c748f19b242fedc2e0
./target/bin-0.18.11/eza_aarch64-unknown-linux-gnu.zip
d699373bf1effa3c2b1dcfa8ffc44a3f
./target/bin-0.18.11/eza_arm-unknown-linux-gnueabihf.tar.gz
fdaa9668edfda38d15352da3253d85f8
./target/bin-0.18.11/eza_arm-unknown-linux-gnueabihf.zip
a0ba17f03a48d0f2e38f2737732f11d1
./target/bin-0.18.11/eza.exe_x86_64-pc-windows-gnu.tar.gz
579b7dbe9cde99cf19c81cce23f47cf7
./target/bin-0.18.11/eza.exe_x86_64-pc-windows-gnu.zip
c5cf74787ecd87fcca8e2769d9b21863
./target/bin-0.18.11/eza_x86_64-unknown-linux-gnu.tar.gz
222ed71159ce5bc7dc05d91e08488779
./target/bin-0.18.11/eza_x86_64-unknown-linux-gnu.zip
08953f7054472626a374a542b5707f77
./target/bin-0.18.11/eza_x86_64-unknown-linux-musl.tar.gz
48c7391f0c9ebe327dc86ba36b02fa98
./target/bin-0.18.11/eza_x86_64-unknown-linux-musl.zip

#### blake3sum

1c4895bc928b452a3caaeaaab72c478c255ab745c525ed4c548e8503528112ef
./target/bin-0.18.11/eza_aarch64-unknown-linux-gnu.tar.gz
935bbe1a941f1c31a21b07df35ed3aa0cc87ff5ffbcf265c42d0478edb2170f8
./target/bin-0.18.11/eza_aarch64-unknown-linux-gnu.zip
b73aa561cd9fd8eb777e437a1da6404a3f2e0a75b7c922ea2135957763e0f514
./target/bin-0.18.11/eza_arm-unknown-linux-gnueabihf.tar.gz
4b6a6bf403aac22a3af8223b5df0c4fab72ade869fa41efe96b77e74df0c42db
./target/bin-0.18.11/eza_arm-unknown-linux-gnueabihf.zip
39eddfe74eeab4600c983586f51e8d219d83cbe3aa7da6a1398db04b5d2c9ad3
./target/bin-0.18.11/eza.exe_x86_64-pc-windows-gnu.tar.gz
782b660d795f19012fa62e85e9a6bbc3a85982f83ff8561d859ae48609ee36e7
./target/bin-0.18.11/eza.exe_x86_64-pc-windows-gnu.zip
9962259ad1b89640a7c3b74c9064e332c2af7b27e8656586c8ac8edaa9879d18
./target/bin-0.18.11/eza_x86_64-unknown-linux-gnu.tar.gz
251c7d928cd7e6671a60bbdbf92204738fb16849626c9b51bf3f8fd951fdfb4b
./target/bin-0.18.11/eza_x86_64-unknown-linux-gnu.zip
c109a4d7bd426571e0ff88c40426f5d8c80b5cb9964376fda5a3184abed6a1cc
./target/bin-0.18.11/eza_x86_64-unknown-linux-musl.tar.gz
7a86aeecd2e39b680c01d142480c0af90d7f6dc60fabc8c63f705f87e72041e5
./target/bin-0.18.11/eza_x86_64-unknown-linux-musl.zip

</details>

<details>
<summary>gruntwork-io/terragrunt (gruntwork-io/terragrunt)</summary>

###
[`v0.57.5`](https://togithub.com/gruntwork-io/terragrunt/releases/tag/v0.57.5)

[Compare
Source](https://togithub.com/gruntwork-io/terragrunt/compare/v0.57.4...v0.57.5)

#### Description

-   Bump `golang.org/x/net` from 0.19.0 to 0.23.0

#### Related links

-
[gruntwork-io/terragrunt#3072

###
[`v0.57.4`](https://togithub.com/gruntwork-io/terragrunt/releases/tag/v0.57.4)

[Compare
Source](https://togithub.com/gruntwork-io/terragrunt/compare/v0.57.3...v0.57.4)

#### Updated CLI args, config attributes and blocks

-   `run-all`
-   `--terragrunt-out-dir`

#### Description

- Added `--terragrunt-out-dir` CLI argument to use Terraform plan in
`run-all` commands from a specific directory.

#### Related links

-
[gruntwork-io/terragrunt#3073

###
[`v0.57.3`](https://togithub.com/gruntwork-io/terragrunt/releases/tag/v0.57.3)

[Compare
Source](https://togithub.com/gruntwork-io/terragrunt/compare/v0.57.2...v0.57.3)

#### Description

-   Fixed getting output from multiple nested dependencies

#### Related links

-
[gruntwork-io/terragrunt#3071

###
[`v0.57.2`](https://togithub.com/gruntwork-io/terragrunt/releases/tag/v0.57.2)

[Compare
Source](https://togithub.com/gruntwork-io/terragrunt/compare/v0.57.1...v0.57.2)

#### Updated CLI args, config attributes and blocks

-   `--terragrunt-json-log`
-   `--terragrunt-tf-logs-to-json`

#### Description

-   Fixed handling of dependency outputs when JSON log format is enabled

#### Related links

-
[gruntwork-io/terragrunt#3049

###
[`v0.57.1`](https://togithub.com/gruntwork-io/terragrunt/releases/tag/v0.57.1)

[Compare
Source](https://togithub.com/gruntwork-io/terragrunt/compare/v0.57.0...v0.57.1)

#### Updated CLI args, config attributes and blocks

-   `--terragrunt-provider-cache-dir`

#### Description

-   Fixed module request routing with provider caching.
-   Fixed resolving relative provider cache dir path.

#### Related links

-
[gruntwork-io/terragrunt#3057

###
[`v0.57.0`](https://togithub.com/gruntwork-io/terragrunt/releases/tag/v0.57.0)

[Compare
Source](https://togithub.com/gruntwork-io/terragrunt/compare/v0.56.5...v0.57.0)

#### Description

**Terraform 1.8 support**: We are now testing Terragrunt against
Terraform 1.8 and is confirmed to be working.

NOTE: Although this release is marked as backward incompatible, it is
functionally compatible as nothing has been changed in Terragrunt
internals. The minor version release is useful to mark the change in
Terraform version that is being tested.

#### Related links

-
[gruntwork-io/terragrunt#3052

</details>

<details>
<summary>junegunn/fzf (junegunn/fzf)</summary>

###
[`v0.50.0`](https://togithub.com/junegunn/fzf/blob/HEAD/CHANGELOG.md#0500)

[Compare
Source](https://togithub.com/junegunn/fzf/compare/0.49.0...0.50.0)

- Search performance optimization. You can observe 50%+ improvement in
some scenarios.
        $ rg --line-number --no-heading --smart-case . > $DATA

        $ wc < $DATA
         5520118 26862362 897487793

$ hyperfine -w 1 -L bin fzf-0.49.0,fzf-7ce6452,fzf-a5447b8,fzf '{bin}
--filter "///" < $DATA | head -30'
        Summary
          fzf --filter "///" < $DATA | head -30 ran
1.16 ± 0.03 times faster than fzf-a5447b8 --filter "///" < $DATA | head
-30
1.23 ± 0.03 times faster than fzf-7ce6452 --filter "///" < $DATA | head
-30
1.52 ± 0.03 times faster than fzf-0.49.0 --filter "///" < $DATA | head
-30
- Added `jump` and `jump-cancel` events that are triggered when leaving
`jump` mode
    ```sh
    ```

</details>

<details>
<summary>kubernetes/kubectl (kubernetes/kubectl)</summary>

###
[`v1.30.0`](https://togithub.com/kubernetes/kubectl/compare/kubernetes-1.29.4...kubernetes-1.30.0-rc.2)

[Compare
Source](https://togithub.com/kubernetes/kubectl/compare/kubernetes-1.29.4...kubernetes-1.30.0-rc.2)

###
[`v1.29.4`](https://togithub.com/kubernetes/kubectl/compare/kubernetes-1.29.3...kubernetes-1.29.4)

[Compare
Source](https://togithub.com/kubernetes/kubectl/compare/kubernetes-1.29.3...kubernetes-1.29.4)

</details>

<details>
<summary>snyk/cli (snyk/cli)</summary>

### [`v1.1290.0`](https://togithub.com/snyk/cli/releases/tag/v1.1290.0)

[Compare
Source](https://togithub.com/snyk/cli/compare/v1.1289.0...v1.1290.0)

##### Bug Fixes

- **code:** Fix error handling for experimental go native code client
([#&#8203;5170](https://togithub.com/snyk/snyk/issues/5170))
([5400c69](https://togithub.com/snyk/snyk/commit/5400c698a2798672e96c91dd18706c2effebc416))

##### Features

- **code:** introduce human readable formatting for experimental test
mechanism ([#&#8203;5174](https://togithub.com/snyk/snyk/issues/5174))
([34bbc95](https://togithub.com/snyk/snyk/commit/34bbc955d241d619177dcdbf5f45bf02342e2adc))
- **sbom:** Introduce experimental sbom test command
([#&#8203;5176](https://togithub.com/snyk/snyk/issues/5176))
([ea6293b](https://togithub.com/snyk/snyk/commit/ea6293b3adabd2459bb10a0ae65f78da8cf1311d))
- snyk woof ro language support and tests
([#&#8203;5166](https://togithub.com/snyk/snyk/issues/5166))
([ed2e754](https://togithub.com/snyk/snyk/commit/ed2e754bace7a37f10a86564d5cf662f69e58daf))

### [`v1.1289.0`](https://togithub.com/snyk/cli/releases/tag/v1.1289.0)

[Compare
Source](https://togithub.com/snyk/cli/compare/v1.1288.1...v1.1289.0)

##### Bug Fixes

- **ls:** Trigger re-analysis after fixing interfile issues
([#&#8203;5163](https://togithub.com/snyk/snyk/issues/5163))
([05cb9f5](https://togithub.com/snyk/snyk/commit/05cb9f5ba9284999269368d1a0a98c8562f4badd))

##### Features

- **code:** Integrate experimental go native code client \[CLI-224]
([#&#8203;5164](https://togithub.com/snyk/snyk/issues/5164))
([5bd898e](https://togithub.com/snyk/snyk/commit/5bd898e708dfb8caaa758debbf7d21998e9f2693))
- include additional policy properties, when provided, in plain text
output ([#&#8203;5142](https://togithub.com/snyk/snyk/issues/5142))
([a8be764](https://togithub.com/snyk/snyk/commit/a8be76486bfc17dda643d18a6fa9475744ddbd5c))
- use workflow data to determine exit code errors
([51c717b](https://togithub.com/snyk/snyk/commit/51c717b20c7eb8de1d2bca48c4d78ed530890b7c))

### [`v1.1288.1`](https://togithub.com/snyk/cli/releases/tag/v1.1288.1)

[Compare
Source](https://togithub.com/snyk/cli/compare/v1.1288.0...v1.1288.1)

##### Bug Fixes

- **iac:** Fix Issue Path in human readable and json output \[IAC-2935]
([#&#8203;5159](https://togithub.com/snyk/snyk/issues/5159))
([5fc3d59](https://togithub.com/snyk/snyk/commit/5fc3d591fefbcf0c5e7615bf4d9899a3a17c7990))

</details>

<details>
<summary>twpayne/chezmoi (twpayne/chezmoi)</summary>

###
[`v2.47.4`](https://togithub.com/twpayne/chezmoi/releases/tag/v2.47.4)

[Compare
Source](https://togithub.com/twpayne/chezmoi/compare/v2.47.3...v2.47.4)

#### Changelog

##### Fixes

- [`d6ad485`](https://togithub.com/twpayne/chezmoi/commit/d6ad485c8)
fix: Fix potential panic when textconv interpreter is empty
- [`b4df44d`](https://togithub.com/twpayne/chezmoi/commit/b4df44dc6)
fix: Fix panic on empty external

##### Documentation updates

- [`872c584`](https://togithub.com/twpayne/chezmoi/commit/872c58479)
docs: Add troubleshooting entry on missing /bin/bash on Nix
- [`8b2a435`](https://togithub.com/twpayne/chezmoi/commit/8b2a4352e)
docs: Add install.doctor to related software
- [`3a3dd13`](https://togithub.com/twpayne/chezmoi/commit/3a3dd1387)
docs: Add links to articles

</details>

<details>
<summary>zellij-org/zellij (zellij-org/zellij)</summary>

###
[`v0.40.0`](https://togithub.com/zellij-org/zellij/releases/tag/v0.40.0)

[Compare
Source](https://togithub.com/zellij-org/zellij/compare/v0.39.2...v0.40.0)

### Release notes

This release includes exciting new features as well as some long awaited
and requested improvements.

#### Some highlights

-   A new welcome screen
-   A new filepicker
-   Pipes
-   Open floating panes at specific coordinates
-   Rearrange tabs
-   Disconnect other clients
-   Plugin aliases
-   New possible keys to bind
-   Start session in the background
-   Performance improvements

Check out the [official
announcement](https://zellij.dev/news/welcome-screen-pipes-filepicker)

Also check out the two new screencasts/tutorials about [session
management](https://zellij.dev/tutorials/session-management/) and [the
new filepicker](https://zellij.dev/tutorials/filepicker/).

#### Are you upgrading from an older version using a custom config file?

In order to take advantage of some of the new features (eg. the
welcome-screen and filepicker), you'll need to swap the `plugins`
section in your [configuration
file](https://zellij.dev/documentation/configuration) with the one from
the [default
file](https://togithub.com/zellij-org/zellij/blob/main/zellij-utils/assets/config/default.kdl#L188-L200).

#### Do you like Zellij? ❤️

Me too! So much so that I spend 100% of my time developing and
maintaining it and have no other income.

Zellij will always be free and open-source. Zellij will never contain
ads or collect your data.

So if the tool gives you value and you are able, please consider [a
recurring monthly donation](https://togithub.com/sponsors/imsnif) of
5-10$ to help me pay my bills. There are Zellij stickers in it for you!

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 4pm on thursday" in timezone
America/Los_Angeles, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

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

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config help](https://togithub.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/scottames/dots).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zMDEuNCIsInVwZGF0ZWRJblZlciI6IjM3LjMwMS40IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiXX0=-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: scottames-github-bot[bot] <162828115+scottames-github-bot[bot]@users.noreply.github.com>
alexcb pushed a commit to earthly/earthly that referenced this pull request Apr 22, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [cli/cli](https://togithub.com/cli/cli) | minor | `v2.47.0` ->
`v2.48.0` |

---

### Release Notes

<details>
<summary>cli/cli (cli/cli)</summary>

### [`v2.48.0`](https://togithub.com/cli/cli/releases/tag/v2.48.0):
GitHub CLI 2.48.0

[Compare Source](https://togithub.com/cli/cli/compare/v2.47.0...v2.48.0)

#### The Big Stuff

- Added support for `--slurp`ing JSON responses in `gh api` by
[@&#8203;heaths](https://togithub.com/heaths) in
[cli/cli#8620
- Added `--skip-ssh-key` option to `gh auth login` command by
[@&#8203;babakks](https://togithub.com/babakks) in
[cli/cli#8935
- Added `numSelectedRepos` to JSON output of `gh secret list` by
[@&#8203;babakks](https://togithub.com/babakks) in
[cli/cli#8899
- Added support for multiple items in `gh api` nested array by
[@&#8203;Ebonsignori](https://togithub.com/Ebonsignori) in
[cli/cli#8762
- Fixed panic when running `gh repo rename` by
[@&#8203;babakks](https://togithub.com/babakks) in
[cli/cli#8906
- Fixed panic when parsing IPv6 remote URLs by
[@&#8203;babakks](https://togithub.com/babakks) in
[cli/cli#8893
- Fixed `gh pr lock/unlock` not working when URL is passed by
[@&#8203;t4kamura](https://togithub.com/t4kamura) in
[cli/cli#8837
- Fixed viewing run logs with filenames that the regex didn't handle
[@&#8203;zdrve](https://togithub.com/zdrve) in
[cli/cli#8882

#### The Rest

- Tidy `go.mod` by
[@&#8203;matthewhughes934](https://togithub.com/matthewhughes934) in
[cli/cli#8958
- Fix cache contention in Go CI jobs by
[@&#8203;matthewhughes934](https://togithub.com/matthewhughes934) in
[cli/cli#8957
- Fix `go` directive in `go.mod` by
[@&#8203;matthewhughes934](https://togithub.com/matthewhughes934) in
[cli/cli#8956
- Update install_linux.md by
[@&#8203;richterdavid](https://togithub.com/richterdavid) in
[cli/cli#8950
- build(deps): bump google.golang.org/grpc from 1.61.1 to 1.61.2 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[cli/cli#8925
- Add codeowners entry for the GitHub TUF root included in the
`attestation` command set by
[@&#8203;malancas](https://togithub.com/malancas) in
[cli/cli#8919
- Create stronger run log cache abstraction by
[@&#8203;williammartin](https://togithub.com/williammartin) in
[cli/cli#8931
- Remove naked returns from git ParseURL by
[@&#8203;williammartin](https://togithub.com/williammartin) in
[cli/cli#8929
- Fix api cache test by
[@&#8203;williammartin](https://togithub.com/williammartin) in
[cli/cli#8932
- Ensure run log cache creates cache dir if it doesn't exist by
[@&#8203;williammartin](https://togithub.com/williammartin) in
[cli/cli#8944
- Close zip file in run view tests by
[@&#8203;williammartin](https://togithub.com/williammartin) in
[cli/cli#8945
- Fix `attestation` cmd offline unit test failure by
[@&#8203;malancas](https://togithub.com/malancas) in
[cli/cli#8933
- Add support to `attestation` command for more predicate types. by
[@&#8203;steiza](https://togithub.com/steiza) in
[cli/cli#8949

#### New Contributors

- [@&#8203;babakks](https://togithub.com/babakks) made their first
contribution in
[cli/cli#8906
- [@&#8203;t4kamura](https://togithub.com/t4kamura) made their first
contribution in
[cli/cli#8837
- [@&#8203;zdrve](https://togithub.com/zdrve) made their first
contribution in
[cli/cli#8882
- [@&#8203;Ebonsignori](https://togithub.com/Ebonsignori) made their
first contribution in
[cli/cli#8762
- [@&#8203;matthewhughes934](https://togithub.com/matthewhughes934) made
their first contribution in
[cli/cli#8958
- [@&#8203;richterdavid](https://togithub.com/richterdavid) made their
first contribution in
[cli/cli#8950

**Full Changelog**: cli/cli@v2.47.0...v2.48.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 4pm on monday" (UTC), Automerge
- At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

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

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/earthly/earthly).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zMTMuMSIsInVwZGF0ZWRJblZlciI6IjM3LjMxMy4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZSJdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@Yardapestr

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external pull request originating outside of the CLI core team
Projects
No open projects
The GitHub CLI
  
Needs review 🤔
Development

Successfully merging this pull request may close these issues.

Output a single JSON document from api --paginate
7 participants