googleapis / googleapis/google-cloudevents-go

Improve error reporting in protoc-gen-go-googlecetypes

Open
#149 0 comments 0 reactions 0 assignees View on GitHub
api: eventarc priority: p2 type: cleanup
Dominant language
Go
Stars
31
Forks
8
PR merge metrics
No merged PRs in 30d

Description

## Current Behavior

Each function in the generator uses log.Fatal or panic on encountering an error.

## Improved Behavior

Return an error from the function and centralize error handling.

## Preferred Behavior

Aggregate all errors from the parsing process and report at once. This has two facets:

1. When assembling data for use in code generation, assemble in advance, aggregate all errors, then flush at the end.
2. Instead of halting the generate-code.sh script on any error, continue processing but ensure to fail the script if any event type has failures

Contributor guide

Open the contributing guide

Research direction

Start by tracing the protoc-gen-go-googlecetypes generator functions that currently call log.Fatal or panic, then inspect generate-code.sh. Determine how parsing and event-type generation failures are propagated and reported; done means errors are aggregated as described and the script still fails when any event type has failures.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, shell
Domain
build-system, tooling
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.