Skip to content

Commit f0b3fba

Browse files
Merge pull request #405 from devtron-labs/release-candidate-v0.47.0
misc: Release candidate v0.47.0
2 parents 7f31e7b + 0980021 commit f0b3fba

4 files changed

Lines changed: 39 additions & 0 deletions

File tree

‎ci-runner/helper/DockerHelper.go‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,9 @@ func (impl *DockerHelperImpl) BuildArtifact(ciRequest *CommonWorkflowRequest) (s
493493
for key, value := range dockerBuildFlags {
494494
dockerBuild = dockerBuild + " " + key + value
495495
}
496+
for _, flag := range dockerBuildConfig.ExtraBuildFlags {
497+
dockerBuild = dockerBuild + " " + flag
498+
}
496499
if !ciRequest.EnableBuildContext || dockerBuildConfig.BuildContext == "" {
497500
dockerBuildConfig.BuildContext = ROOT_PATH
498501
}

‎ci-runner/helper/EventHelper.go‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ type DockerBuildConfig struct {
7474
BuildxProvenanceMode string `json:"buildxProvenanceMode"`
7575
BuildxK8sDriverOptions []map[string]string `json:"buildxK8SDriverOptions"`
7676

77+
// ExtraBuildFlags is an opaque list of already-formatted docker build flags
78+
ExtraBuildFlags []string `json:"extraBuildFlags,omitempty"`
79+
7780
//ent only
7881
BuildxDriverImage string `json:"buildxDriverImage"`
7982
}

‎common-lib/pubsub-lib/audit/AuditLogEvent.go‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ type EnrichmentEntity struct {
4444
Identifier string `json:"identifier"`
4545
}
4646

47+
// AdditionalInfoEntry is a typed extra-info bag; publish may emit an empty marker that enrichment fills.
48+
type AdditionalInfoEntry struct {
49+
Type AuditInfoType `json:"type"`
50+
Data map[string]interface{} `json:"data,omitempty"`
51+
}
52+
4753
// AuditLogEvent is the canonical NATS payload published on AUDIT_LOG_TOPIC.
4854
// It is shared between the publisher (orchestrator) and the consumer
4955
// (audit-log service) so both agree on the contract.
@@ -61,6 +67,8 @@ type AuditLogEvent struct {
6167
ResponseTime time.Duration `json:"responseTime"` // request handling duration (nanoseconds)
6268
Payload map[string]interface{} `json:"payload"` // the actual request body of the audited call, always present
6369
EnrichmentContext map[string]EnrichmentEntity `json:"enrichmentContext,omitempty"`
70+
Role string `json:"role,omitempty"` // display name of the acting user's role scoped to the resource acted upon (e.g. "Super Admin", "Manager")
71+
AdditionalInfo []AdditionalInfoEntry `json:"additionalInfo,omitempty"` // typed extra info (e.g. config diff coordinates), filled at enrich time
6472
}
6573

6674
// NewAuditLogEvent constructs an event with the structural metadata parsed
@@ -114,6 +122,13 @@ func (e *AuditLogEvent) WithAction(action string) *AuditLogEvent {
114122
return e
115123
}
116124

125+
// WithRole sets the display name of the acting user's role scoped to the resource
126+
// acted upon (e.g. "Super Admin", "Manager").
127+
func (e *AuditLogEvent) WithRole(role string) *AuditLogEvent {
128+
e.Role = role
129+
return e
130+
}
131+
117132
// WithPayloadField adds a single key/value to the payload bag.
118133
func (e *AuditLogEvent) WithPayloadField(key string, value interface{}) *AuditLogEvent {
119134
if e.Payload == nil {
@@ -137,6 +152,12 @@ func (e *AuditLogEvent) WithEnrichment(entity, identifier string) *AuditLogEvent
137152
return e
138153
}
139154

155+
// WithAdditionalInfo appends a typed extra-info entry (publish stamps an empty marker; enrichment fills it).
156+
func (e *AuditLogEvent) WithAdditionalInfo(infoType AuditInfoType, data map[string]interface{}) *AuditLogEvent {
157+
e.AdditionalInfo = append(e.AdditionalInfo, AdditionalInfoEntry{Type: infoType, Data: data})
158+
return e
159+
}
160+
140161
// Marshal serializes the event to a JSON string for PubSubClientService.Publish.
141162
func (e *AuditLogEvent) Marshal() (string, error) {
142163
data, err := json.Marshal(e)

‎common-lib/pubsub-lib/audit/constants.go‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
//go:generate go run github.com/devtron-labs/common-lib/tools/strenum -type=AuditModule
2323
//go:generate go run github.com/devtron-labs/common-lib/tools/strenum -type=AuditResource
2424
//go:generate go run github.com/devtron-labs/common-lib/tools/strenum -type=AuditAction
25+
//go:generate go run github.com/devtron-labs/common-lib/tools/strenum -type=AuditInfoType
2526
package audit
2627

2728
// AuditModule is the top-level functional area an audited action belongs to.
@@ -134,6 +135,17 @@ const (
134135
ActionApply AuditAction = "Apply"
135136
)
136137

138+
// AuditInfoType names a kind of typed extra info carried in
139+
// AuditLogEvent.AdditionalInfo. Values are human-readable.
140+
type AuditInfoType string
141+
142+
func (t AuditInfoType) ToString() string { return string(t) }
143+
144+
const (
145+
// AuditInfoConfigDiff carries config before/after history-version coordinates.
146+
AuditInfoConfigDiff AuditInfoType = "Config Diff"
147+
)
148+
137149
// Enrichment entity keys used in AuditLogEvent.EnrichmentContext. These name
138150
// the entity whose identifier the audit-log service resolves into a full
139151
// record (e.g. "app" -> app_id -> application name/team/etc).

0 commit comments

Comments
 (0)