vmware / vmware/go-ipfix

When running build_registry.go multiple times, we hit resource not modified http error 304

Open
#98 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug high-priority
Dominant language
Go
Stars
52
Forks
34
Avg merge
9h 39m
Merged PRs (30d)
7

Description

Describe the bug
With code generation check worflow, we run build_registry.go multiple times in quick succession. During its run, we do http.get on https://www.iana.org/assignments/ipfix/ipfix-information-elements.csv. There is cache control introduced on this link/resource, so we hit the error 304. Because of this error, we generate empty pkg/registry/registry_IANA.go file.
In addition, because of this code generation check workflow fails on PRs.

To Reproduce
Run the following commands multiple times in quick succession:
go run pkg/registry/build_registry/build_registry.go

Expected behavior
Even with multiple runs of build_registry.go, we should see proper generation of the file, pkg/registry/registry_IANA.go with all the info elements in it.

Actual Behavior
Because of this HTTP error, we generate empty go file.

Versions
master branch ToT.

Additional context
Add any other context about the problem here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with pkg/registry/build_registry/build_registry.go and run go run pkg/registry/build_registry/build_registry.go repeatedly to observe the HTTP 304 failure. Trace how the response is handled before writing pkg/registry/registry_IANA.go. Done means repeated runs produce a populated registry_IANA.go file and the code-generation check no longer fails.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.