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

Simplify id & remove resource fields #105

Merged
merged 1 commit into from
Sep 3, 2024
Merged

Conversation

fornellas
Copy link
Owner

@fornellas fornellas commented Aug 26, 2024

All resource types must have both an "id" field, that uniquely identifies the resource at a host, and a "remove" field, to inform whether it should be... removed.

As of now, both fields are mandatory, but they can live anywhere in the struct, and the Id field, requires a special tag.

This PR simplifies that, enforcing instead that all resources have the first 2 fields as such:

type Foo struct {
FooName string `yaml:"foo_name"`
Remove bool `yaml:"remove,omitempty"`
}

which simplifies things quite a bit.

In particular, when marshaling yamls, the id field will be guaranteed to be the first one, which eases understanding.


Stack:

⚠️ Part of a stack created by spr. Do not merge manually using the UI - doing so may have unexpected results.

@fornellas fornellas changed the base branch from spr/master/4d62c05f to master August 26, 2024 19:56
@fornellas fornellas changed the base branch from master to spr/master/4d62c05f August 26, 2024 19:56
@fornellas fornellas mentioned this pull request Aug 26, 2024
@fornellas fornellas force-pushed the spr/master/aa4f43b2 branch 3 times, most recently from d5111a1 to 2639a66 Compare August 28, 2024 15:03
@fornellas fornellas changed the base branch from spr/master/4d62c05f to master August 28, 2024 15:26
@fornellas fornellas changed the base branch from master to spr/master/4d62c05f August 28, 2024 15:27
@fornellas fornellas changed the base branch from spr/master/4d62c05f to master August 28, 2024 21:36
@fornellas fornellas changed the base branch from master to spr/master/4d62c05f August 28, 2024 21:36
@fornellas fornellas mentioned this pull request Aug 28, 2024
@fornellas fornellas changed the base branch from spr/master/4d62c05f to master August 28, 2024 22:53
@fornellas fornellas mentioned this pull request Aug 28, 2024
@fornellas fornellas changed the base branch from master to spr/master/4d62c05f August 28, 2024 22:53
@fornellas fornellas changed the base branch from spr/master/4d62c05f to master August 29, 2024 21:42
@fornellas fornellas changed the base branch from master to spr/master/4d62c05f August 29, 2024 21:42
@fornellas fornellas mentioned this pull request Aug 30, 2024
@fornellas fornellas changed the base branch from spr/master/4d62c05f to master September 1, 2024 10:44
@fornellas fornellas changed the base branch from spr/master/4d62c05f to master September 1, 2024 15:10
@fornellas fornellas changed the base branch from master to spr/master/4d62c05f September 1, 2024 15:10
fornellas added a commit that referenced this pull request Sep 1, 2024
PR #90 introduced sections and logs as info when a new section is
created. However, if the log level is higher (eg: warn), then the
section won't be logged, and any higher level log (eg: warn, error) will
be indented without a section.

This PR fixes that, by only enabling indentation when the level info is
enabled.

---

**Stack**:
- #107
- #108
- #111
- #110
- #109
- #106
- #105
- #104
- #103
- #102
- #101
- #112⚠️ *Part of a stack created by [spr](https://github.com/ejoffe/spr). Do
not merge manually using the UI - doing so may have unexpected results.*
@fornellas fornellas changed the base branch from spr/master/4d62c05f to master September 1, 2024 15:15
@fornellas fornellas changed the base branch from master to spr/master/4d62c05f September 1, 2024 15:16
@fornellas fornellas force-pushed the spr/master/aa4f43b2 branch 2 times, most recently from 50cb5ee to 1e1f5f2 Compare September 1, 2024 18:01
fornellas added a commit that referenced this pull request Sep 1, 2024
On #75 we dropped arm 32bit support (we'll decide on
#124 what to do about it).
There was left over references, which are [breaknig the
build](https://github.com/fornellas/resonance/actions/runs/10646571228):

```
The workflow is not valid. .github/workflows/push.yaml (Line: 57, Col: 9): Job 'release' depends on unknown job 'linux_arm'. .github/workflows/push.yaml (Line: 100, Col: 9): Job 'coveralls' depends on unknown job 'linux_arm'.
```

This PR fixes that, by erasing all arm 32 references.

---

**Stack**:
- #116
- #107
- #108
- #111
- #110
- #109
- #106
- #105
- #104
- #103
- #102
- #101
- #112
- #126
- #129⚠️ *Part of a stack created by [spr](https://github.com/ejoffe/spr). Do
not merge manually using the UI - doing so may have unexpected results.*
fornellas added a commit that referenced this pull request Sep 1, 2024
Mostly just moving the test grpc agent from #75 to a place that matches
the HTTP agent placement.

Bonus:

- Call go build to both client & server, so we can actually easily bulid
& manually test them.
- Fix a bug with `RRB_IGNORE_PATTERN` not ignoring generated `.go`
files, so RRB would just re-trigger itself and never finish.

commit-id:b4b6383b

---

**Stack**:
- #116
- #107
- #108
- #111
- #110
- #109
- #106
- #105
- #104
- #103
- #102
- #101
- #130
- #126⚠️ *Part of a stack created by [spr](https://github.com/ejoffe/spr). Do
not merge manually using the UI - doing so may have unexpected results.*
@fornellas fornellas force-pushed the spr/master/aa4f43b2 branch 5 times, most recently from eedb846 to 31dc195 Compare September 3, 2024 22:47
Base automatically changed from spr/master/4d62c05f to master September 3, 2024 22:48
All resource types must have both an "id" field, that uniquely identifies the resource at a host, and a "remove" field, to inform whether it should be... removed.

As of now, both fields are mandatory, but they can live anywhere in the struct, and the Id field, requires a special tag.

This PR simplifies that, enforcing instead that all resources have the first 2 fields as such:

```go
type Foo struct {
	FooName string `yaml:"foo_name"`
	Remove bool `yaml:"remove,omitempty"`
}
```

which simplifies things quite a bit.

In particular, when marshaling yamls, the id field will be guaranteed to be the first one, which eases understanding.

commit-id:aa4f43b2
@fornellas fornellas merged commit 1e0e27b into master Sep 3, 2024
3 of 4 checks passed
@fornellas fornellas deleted the spr/master/aa4f43b2 branch September 3, 2024 22:48
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.

2 participants