Adding update instance headers API
What does this MR do and why?
Added GraphQL API for updating streaming headers for instance level external audit event destinations.
GraphQL API
mutation {
auditEventsStreamingInstanceHeadersUpdate(input: { headerId: "gid://gitlab/AuditEvents::Streaming::InstanceHeader/3", key: "new-key", value: "new-value" }) {
errors
header {
id
key
value
}
}
}
Query plan
Query - Click to expand
UPDATE
"instance_audit_events_streaming_headers"
SET
"updated_at" = '2023-06-12 12:58:24.503241',
"key" = 'new-key',
"value" = 'new-value'
WHERE
"instance_audit_events_streaming_headers"."id" = 40
https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/19381/commands/64007
Note: Since this is an instance level API, there are no records on production.
How to set up and validate locally
- Enable the feature flag from rails console by running
Feature.enable(:ff_external_audit_events)
. - Open graphql-explorer console in browser by opening url http://127.0.0.1:3000/-/graphql-explorer.
- Run following mutation in the graphql explorer and note down the id, which would be something like
gid://gitlab/AuditEvents::InstanceExternalAuditEventDestination/<id>
from output.
mutation {
instanceExternalAuditEventDestinationCreate(input: { destinationUrl: "https://www.example.com"}) {
errors
instanceExternalAuditEventDestination {
destinationUrl
id
}
}
}
- Run the following graphql command in explorer for creating a header created for destination created in step 3, note down the id of header:
mutation {
auditEventsStreamingInstanceHeadersCreate(input:
{
key: "header1",
value: "header1value",
destinationId: "gid://gitlab/AuditEvents::InstanceExternalAuditEventDestination/<id>"
}) {
errors
header {
id
key
value
}
}
}
- Run following mutation for updating the header, it should return with a successful response:
mutation {
auditEventsStreamingInstanceHeadersUpdate(input: { headerId: "gid://gitlab/AuditEvents::Streaming::InstanceHeader/<id>", key: "new-key", value: "new-value" }) {
errors
header {
id
key
value
}
}
}
- You can also check the updated value in rails console by running
AuditEvents::Streaming::InstanceHeader.last.key
or simplyAuditEvents::Streaming::InstanceHeader.last
.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #404560 (closed)
Merge request reports
Activity
changed milestone to %16.1
assigned to @hraghuvanshi
- A deleted user
added frontend label
1 Warning Please add a merge request subtype to this merge request. 1 Message This merge request adds or changes documentation files. A review from the Technical Writing team before you merge is recommended. Reviews can happen after you merge. Documentation review
The following files require a review from a technical writer:
-
doc/api/graphql/reference/index.md
(Link to current live version)
The review does not need to block merging this merge request. See the:
-
Metadata for the
*.md
files that you've changed. The first few lines of each*.md
file identify the stage and group most closely associated with your docs change. - The Technical Writer assigned for that stage and group.
- Documentation workflows for information on when to assign a merge request for review.
Reviewer roulette
Changes that require review have been detected!
Please refer to the table below for assigning reviewers and maintainers suggested by Danger in the specified category:
Category Reviewer Maintainer backend Sylvester Chin (
@schin1
) (UTC+8, 2.5 hours ahead of@hraghuvanshi
)Brian Williams (
@bwill
) (UTC-5, 10.5 hours behind@hraghuvanshi
)groupcompliance Reviewer review is optional for groupcompliance Camellia X. Yang (
@cam.x
) (UTC+0, 5.5 hours behind@hraghuvanshi
)To spread load more evenly across eligible reviewers, Danger has picked a candidate for each review slot, based on their timezone. Feel free to override these selections if you think someone else would be better-suited or use the GitLab Review Workload Dashboard to find other available reviewers.
To read more on how to use the reviewer roulette, please take a look at the Engineering workflow and code review guidelines. Please consider assigning a reviewer or maintainer who is a domain expert in the area of the merge request.
Once you've decided who will review this merge request, assign them as a reviewer! Danger does not automatically notify them for you.
If needed, you can retry the
danger-review
job that generated this comment.Generated by
Danger-
Bundle size analysis [beta]
This compares changes in bundle size for entry points between the commits d03242a7 and 1691b88b
Special assetsEntrypoint / Name Size before Size after Diff Diff in percent average 4.11 MB 4.11 MB - 0.0 % mainChunk 2.99 MB 2.99 MB - 0.0 %
Please look at the full report for more details
Read more about how this report works.
Generated by
DangerAllure report
allure-report-publisher
generated test report!e2e-test-on-gdk:
test report for 81d743d0expand test summary
+-----------------------------------------------------------------------+ | suites summary | +------------------+--------+--------+---------+-------+-------+--------+ | | passed | failed | skipped | flaky | total | result | +------------------+--------+--------+---------+-------+-------+--------+ | Plan | 4 | 0 | 0 | 0 | 4 | ✅ | | Monitor | 4 | 0 | 0 | 0 | 4 | ✅ | | Framework sanity | 0 | 0 | 1 | 0 | 1 | ➖ | | Manage | 1 | 0 | 0 | 0 | 1 | ✅ | | Create | 8 | 0 | 1 | 0 | 9 | ✅ | | Data Stores | 2 | 0 | 0 | 1 | 2 | ❗ | | Govern | 2 | 0 | 0 | 0 | 2 | ✅ | +------------------+--------+--------+---------+-------+-------+--------+ | Total | 21 | 0 | 2 | 1 | 23 | ❗ | +------------------+--------+--------+---------+-------+-------+--------+
e2e-review-qa:
test report for 1691b88bexpand test summary
+-----------------------------------------------------------------------+ | suites summary | +------------------+--------+--------+---------+-------+-------+--------+ | | passed | failed | skipped | flaky | total | result | +------------------+--------+--------+---------+-------+-------+--------+ | Data Stores | 2 | 0 | 0 | 1 | 2 | ❗ | | Govern | 21 | 0 | 0 | 0 | 21 | ✅ | | Create | 8 | 0 | 1 | 0 | 9 | ✅ | | Monitor | 4 | 0 | 0 | 0 | 4 | ✅ | | Plan | 3 | 0 | 1 | 0 | 4 | ✅ | | Manage | 1 | 0 | 0 | 0 | 1 | ✅ | | Framework sanity | 0 | 0 | 1 | 0 | 1 | ➖ | +------------------+--------+--------+---------+-------+-------+--------+ | Total | 39 | 0 | 3 | 1 | 42 | ❗ | +------------------+--------+--------+---------+-------+-------+--------+
added 1054 commits
Toggle commit listadded 316 commits
-
1691b88b...ea70798f - 315 commits from branch
master
- ac55f7a6 - Update API for instance headers
-
1691b88b...ea70798f - 315 commits from branch
marked the checklist item I have evaluated the MR acceptance checklist for this MR. as completed
requested review from @schin1
- Resolved by Sylvester Chin
- Resolved by Sylvester Chin
- Resolved by Sylvester Chin
removed review request for @schin1
requested review from @schin1
@schin1
, thanks for approving this merge request.This is the first time the merge request is approved. To ensure full test coverage, a new pipeline will be started shortly.
For more info, please refer to the following links:
added pipeline:mr-approved label
removed review request for @abdwdd
added 132 commits
-
ac55f7a6...a4b09505 - 130 commits from branch
master
- 27f39641 - Removed unnecessary condition
- 81d743d0 - Merge branch 'master' into 404560-gq-apis-update
-
ac55f7a6...a4b09505 - 130 commits from branch
removed review request for @cam.x
@hraghuvanshi I am a designer not a developer, I don't think I should review those backend changes. I remove myself from approval
requested review from @mwoolf
- Resolved by Max Woolf
@harsimarsandhu Can you please do groupcompliance review here?
requested review from @harsimarsandhu
removed review request for @mwoolf
removed review request for @harsimarsandhu
requested review from @mwoolf
enabled an automatic merge when the pipeline for cd4ecf32 succeeds
mentioned in commit b2480d2d
added workflowstaging-canary label and removed workflowin dev label
added workflowcanary label and removed workflowstaging-canary label
added self-managed workflowstaging labels and removed self-managed workflowcanary labels
added workflowproduction label and removed workflowstaging label
added self-managed workflowpost-deploy-db-production labels and removed self-managed workflowproduction labels
mentioned in merge request !123895 (merged)
added releasedcandidate self-managed labels and removed self-managed label
mentioned in issue gitlab-com/www-gitlab-com#14504 (closed)
added releasedpublished label and removed releasedcandidate label