Backfill StatusPage::PublishedIncidents and add /publish quick action
What does this MR do?
- Backfills table for
::StatusPage::PublishedIncidentwith entries for all public issues for which status page is enabled & are not confidential (idempotent). This is a new feature with low usage, so this will be fairly few rows.
PublishServiceto determine whether to publish an issue based on whether an entry in
::StatusPage::PublishedIncidentexists (was & still is idempotent)
- Adds a
/publishquick action which only appears for developers+ on non-published issues.
- Not changed:
confidentialissues still cannot be published.
Related issue: #209849 (closed)
MRs for full feature:
!29994 (merged) - Adds
- !30880 (merged) - Adds helpers for system note create for publish events
!30893 (merged) - Adds helpers for creating/deleting
!31380 (merged) - Rename
!31381 (merged) - Move
PublishServicepublish vs unpublish check into reusable method
- !31395 (merged) - Add flow to publish an issue directly
- !31480 (merged) - Documentation
$ rake db:migrate == 20200421195234 BackfillStatusPagePublishedIncidents: migrating ============= == 20200421195234 BackfillStatusPagePublishedIncidents: migrated (0.0630s) ==== $ rake db:migrate:down VERSION=20200421195234 == 20200421195234 BackfillStatusPagePublishedIncidents: reverting ============= == 20200421195234 BackfillStatusPagePublishedIncidents: reverted (0.0000s) ====
Migration query execution plan:
SELECT * FROM issues INNER JOIN status_page_settings ON status_page_settings.project_id = issues.project_id WHERE status_page_settings.enabled = true AND issues.confidential = false
Nested Loop (cost=0.56..263.10 rows=137 width=3572) (actual time=9.835..24.239 rows=6 loops=1) Buffers: shared hit=5 read=13 I/O Timings: read=24.054 -> Seq Scan on public.status_page_settings (cost=0.00..4.02 rows=1 width=2265) (actual time=0.889..0.891 rows=2 loops=1) Filter: status_page_settings.enabled Rows Removed by Filter: 0 Buffers: shared read=1 I/O Timings: read=0.878 -> Index Scan using index_issues_on_project_id_and_iid on public.issues (cost=0.56..257.71 rows=137 width=1307) (actual time=7.107..11.666 rows=3 loops=2) Index Cond: (issues.project_id = status_page_settings.project_id) Filter: (NOT issues.confidential) Rows Removed by Filter: 0 Buffers: shared hit=5 read=12 I/O Timings: read=23.176
Time: 24.774 ms - planning: 0.476 ms - execution: 24.298 ms - I/O read: 24.054 ms - I/O write: 0.000 ms Shared buffers: - hits: 5 (~40.00 KiB) from the buffer pool - reads: 13 (~104.00 KiB) from the OS file cache, including disk I/O - dirtied: 0 - writes: 0
|On issue creation:||Upon adding a note:||Failure message (not reproducible outside of specs; only unforeseen issues):|
Does this MR meet the acceptance criteria?
- Changelog entry
- [-] Documentation (if required) - follow-up !31480 (merged)
- Code review guidelines
- Merge request performance guidelines
- Style guides
- [-] Database guides
- Separation of EE specific content
Availability and Testing
- Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process.
- [-] Tested in all supported browsers
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
- [-] Label as security and @ mention
- [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
- [-] Security reports checked/validated by a reviewer from the AppSec team