#Returning a dagger.cloud trace to a gitlab artifacts.external_link

1 messages · Page 1 of 1 (latest)

late crypt
#

So we canceled our migration to Github from Gitlab after the runner rugpull which means we can't use the dagger Github action. One of the biggest complaints of my team on Gitlab is the number of clicks it takes to get to a dagger cloud trace.

https://docs.gitlab.com/ci/yaml/artifacts_reports/#external_link is the artifact type for external links so users can 1-click into a dagger cloud trace.

Has anyone gotten this working? If not, how do I get a cloud trace url in dagger as a return object?

astral harbor
late crypt
#

Thanks, super useful.

@astral harbor it's not clear how this would work, though, with multiple return types.

Let's say we have code like the following from https://docs.dagger.io/cookbook/errors/#continue-using-a-container-after-command-execution-fails since with gitlab, you want reports AND exit code to be emitted.

@dagger.object
class CIReturn:
    exit_code: int = dagger.field()
    gitlab_artifacts: dagger.Directory() # contains an annotation for the trace along with all of my code/test/etc reports

And then to get my code, I have to do the following, right?

 script:
    - dagger call my_module ci-with-reports report export --path=./reports/
    - exit $(dagger call my_module ci-with-reports exit-code)
  • Because the run should be the same between each run because of caching, it should be the same, right?
  • Also, would this double our trace costs in dagger.cloud?
  • Is there any way to return an exit code along with a return type from dagger? That seems super useful for CI.

Learn how to handle and debug errors in Dagger workflows.

late crypt
#

As I'm thinking about this, wrapping my output in an exit code would be really great.

astral harbor
#

@late crypt using a dagger shell script is quite convenient for that.

something like:

#!/usr/bin/env dagger

out=$(test)
$out | result | export ./out

exit=$($out | exit-code)

.exit $exit

should work

#

that exports the file to a local path as well as exiting the script with the correct exit code