feat: update BGP community structure and related documentation. Refactor BGP community handling by renaming fields from 'name' and 'kind' to 'community' and 'title' across the codebase. Update OpenAPI specifications, database interactions, and UI components to reflect these changes, enhancing clarity and consistency in community management.
CI / changes (push) Successful in 5s
CI / openapi (push) Successful in 25s
CI / go (push) Successful in 24s
CI / docker-web (deploy/docker/evobgp-web/Dockerfile, , evobgp-web) (push) Successful in 1m1s
CI / docker-web (deploy/docker/evobgp-web/Dockerfile, evobgp-all, evobgp-web-all) (push) Successful in 1m1s
CI / docker-bird (push) Has been skipped
CI / bird2 (push) Successful in 15s
CI / docker-go (evobgp-all, 1, deploy/docker/gobinary/Dockerfile, , evobgp-all) (push) Has been cancelled
CI / docker-go (evobgp-api, 1, deploy/docker/gobinary/Dockerfile, , evobgp-api) (push) Has been cancelled
CI / docker-go (evobgp-deploy, 0, deploy/docker/gobinary/Dockerfile, , evobgp-deploy) (push) Has been cancelled
CI / docker-go (evobgp-ingest, 0, deploy/docker/gobinary/Dockerfile, , evobgp-ingest) (push) Has been cancelled
CI / docker-go (evobgp-node, 0, deploy/docker/gobinary/Dockerfile, , evobgp-node) (push) Has been cancelled
CI / docker-go (evobgp-render, 0, deploy/docker/gobinary/Dockerfile, , evobgp-render) (push) Has been cancelled
CI / docker-go (evobgp-scheduler, 0, deploy/docker/gobinary/Dockerfile, , evobgp-scheduler) (push) Has been cancelled
CI / docker-go (deploy/docker/evobgp-agent/Dockerfile, , evobgp-agent) (push) Successful in 1m1s

This commit is contained in:
Denozordec
2026-04-06 14:52:29 +07:00
parent 482eeb122d
commit a2cbfacd45
20 changed files with 226 additions and 88 deletions
+17 -2
View File
@@ -33,6 +33,8 @@ func MaterializedASPrefixKey(asn int64) string {
// RefreshModule runs ingest (where applicable) for one module, then renders a new revision whose
// BIRD materialization includes prefixes from all enabled modules of the tenant (others via live collect).
// If the tenant-wide materialized prefix set is unchanged from the latest revision, returns that
// revision id and does not insert a duplicate config_revision.
func RefreshModule(ctx context.Context, st store.Backend, hc *http.Client, tenantID, moduleID string) (revisionID string, err error) {
if hc == nil {
hc = http.DefaultClient
@@ -50,13 +52,17 @@ func RefreshModule(ctx context.Context, st store.Backend, hc *http.Client, tenan
return "", err
}
revisionID = uuid.NewString()
parent := parentRevision(st, tenantID, moduleID)
agg, err := aggregateTenantPrefixRows(ctx, st, hc, tenantID, moduleID, rows)
if err != nil {
return "", err
}
hash := hashAggregatedMaterialization(tenantID, agg)
if prev := latestTenantRevision(st, tenantID); prev != nil && prev.ContentHash == hash {
return prev.ID, nil
}
revisionID = uuid.NewString()
parent := parentRevision(st, tenantID, moduleID)
preview, err := buildPreviewFragments(st, tenantID, moduleID, revisionID, agg)
if err != nil {
return "", err
@@ -233,6 +239,15 @@ func parentRevision(st store.Backend, tenantID, moduleID string) *string {
return &id
}
// latestTenantRevision is the newest config_revision for the tenant (any module), or nil.
func latestTenantRevision(st store.Backend, tenantID string) *store.Revision {
items, _, _ := st.ListRevisions(tenantID, "", "", 1)
if len(items) == 0 {
return nil
}
return items[0]
}
// hashAggregatedMaterialization hashes the full tenant-wide prefix set used for BIRD (all enabled modules).
func hashAggregatedMaterialization(tenantID string, rows []store.PrefixRow) string {
type line struct{ p, c, s string }