Skip to content

Conversation

@cognifloyd
Copy link
Member

Currently, we're abusing the Step and Container models to allow reporting on build setup (eg when Docker initializes the Network and Volumes). This means that we have to check for the special "init" stage/step/container in many places. This makes "Init" reporting a first-class-citizen, instead of shoe-horning it into steps and containers (which was admittedly an excellent MVP).

An InitStep is a report by a "reporter" about a discrete part of the build setup. The "reporter" would be a logical part of the stack, for example "Pipeline Compiler", "Docker Runtime", "Kubernetes Runtime", ... For example, we could have these reporters be discrete initsteps:

  • Pipeline Compiler: report info/debug logs
  • Docker Runtime: report network setup
  • Docker Runtime: report volume setup
  • Kubernetes Runtime: Pod YAML

Similar to a Step, where the log data is stored in a separate Log struct/table, the InitStep is also associated with a Log that stores the actual log/report. The InitStep however can also specify a mimetype for the output, which is meant for eventual consumption by the UI to do syntax highlighting if relevant.

So, this adds:

  • database/initstep
  • router/initstep, router/middleware/initstep, api/initstep, mock/server/initstep
  • InitStep support in database/log
  • InitStep support in router/log, router/middleware/log, api/log, mock/server/log

And then I also added example logs in and around the compiler (in api/webhook and api/build). Not everything that compiles a template has a build it can associate a log with, so logs get created only after the build is ready.

@cognifloyd cognifloyd self-assigned this Mar 3, 2023
@cognifloyd cognifloyd requested a review from a team as a code owner March 3, 2023 09:01
@codecov
Copy link

codecov bot commented Mar 3, 2023

Codecov Report

Merging #779 (2c889d2) into main (73f83fc) will decrease coverage by 2.13%.
The diff coverage is 39.84%.

❗ Current head 2c889d2 differs from pull request most recent head e6b036c. Consider uploading reports for the commit e6b036c to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #779      +/-   ##
==========================================
- Coverage   56.48%   54.36%   -2.13%     
==========================================
  Files         243      260      +17     
  Lines       16164    17316    +1152     
==========================================
+ Hits         9131     9413     +282     
- Misses       6628     7486     +858     
- Partials      405      417      +12     
Impacted Files Coverage Δ
api/deployment.go 0.00% <ø> (ø)
api/log.go 0.00% <0.00%> (ø)
api/step.go 0.00% <ø> (ø)
api/stream.go 0.00% <0.00%> (ø)
api/webhook.go 0.00% <0.00%> (ø)
compiler/native/native.go 80.00% <0.00%> (-4.45%) ⬇️
compiler/native/substitute.go 70.00% <ø> (ø)
database/log/delete.go 75.00% <0.00%> (-10.72%) ⬇️
database/log/table.go 100.00% <ø> (ø)
api/build.go 1.76% <4.58%> (+0.28%) ⬆️
... and 24 more

... and 10 files with indirect coverage changes

@cognifloyd
Copy link
Member Author

Closed with go-vela/community#771

@cognifloyd cognifloyd closed this Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant