Commit Graph

24 Commits

Author SHA1 Message Date
Michael Kozono 1ce0595b18 Backport: Propagate broadcast messages to secondaries 2018-04-11 11:28:44 -07:00
Tiago Botelho cfd475a45e Removes default scope from sortable 2017-09-07 13:01:59 +01:00
Yorick Peterse e0b589f161
Fix caching of future broadcast messages
This changes the caching mechanism so we cache both current _and_ future
broadcast messages, then manually filter out those we don't want to
display. This ensures we don't need any additional queries while still
being able to display the right messages at the right time.

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/36661
2017-08-21 17:58:37 +02:00
Yorick Peterse a5c8a52782
Better caching and indexing of broadcast messages
Caching of BroadcastMessage instances has been changed so a cache stays
valid as long as the default cache expiration time permits, instead of
the cache being expired after 1 minute. When modifying broadcast
messages the cache is flushed automatically.

To remove the need for performing sequence scans on the
"broadcast_messages" table we also add an index on (starts_at, ends_at,
id), permitting PostgreSQL to use an index scan to get all necessary
data.

Finally this commit adds a few NOT NULL constraints to the table to
match the Rails validations.

Fixes gitlab-org/gitlab-ce#31706
2017-08-11 16:43:30 +02:00
Mike Ricketts 03b2ac659e #13336 - display multiple messages in both the UI and git output 2017-06-15 13:47:33 +00:00
Nick Thomas e94cd6fdfe Add markdown cache columns to the database, but don't use them yet
This commit adds a number of _html columns and, with the exception of Note,
starts updating them whenever the content of their partner fields changes.

Note has a collision with the note_html attr_accessor; that will be fixed later

A background worker for clearing these cache columns is also introduced - use
`rake cache:clear` to set it off. You can clear the database or Redis caches
separately by running `rake cache:clear:db` or `rake cache:clear:redis`,
respectively.
2016-10-07 02:54:25 +01:00
Jeroen van Baarsen f1479b56b7
Remove the annotate gem and delete old annotations
In 8278b763d9 the default behaviour of annotation
has changes, which was causing a lot of noise in diffs. We decided in #17382
that it is better to get rid of the whole annotate gem, and instead let people
look at schema.rb for the columns in a table.

Fixes: #17382
2016-05-09 18:00:28 +02:00
Zeger-Jan van de Weg 47da013cf8 Annotate the models 2016-05-06 08:27:46 +02:00
Josh Frye a6d6cfaf92 Change ttl to 1 minute 2016-01-29 13:39:33 -05:00
Josh Frye d8a292d907 Cache BroadcastMessage.current for 5 minutes. Fixes #12770 2016-01-29 13:39:33 -05:00
Robert Speicher 843662821d Move `BroadcastMessage#status` to a helper since it's presentational 2016-01-13 11:49:59 -05:00
Robert Speicher df496fcaf0 Update BroadcastMessage model
- Adds default values for `color` and `font` attributes
- Adds `active?`, `started?`, `ended?`, and 'status' methods
2016-01-13 11:34:58 -05:00
Robert Speicher 6ae39c2cd1 Remove alert_type attribute from BroadcastMessage 2016-01-13 11:34:57 -05:00
Robert Speicher e48391b813 Add custom ColorValidator 2015-12-07 16:57:26 -05:00
Dmitriy Zaporozhets 62ed1c537e Explicitly define ordering in models using default_scope 2015-02-05 14:20:55 -08:00
Dmitriy Zaporozhets 3a21c904dd
Use strong params for 5 more models
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-06-26 15:00:09 +03:00
Dmitriy Zaporozhets 74bcc8321e
Allow set broadcast color with 3 digits like #444
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-06-04 11:04:36 +03:00
Dmitriy Zaporozhets 36f861f1b1
Re-annotate models
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-04-09 15:05:03 +03:00
Dmitriy Zaporozhets d1e8495890
Add validations to BroadcastMessage color and font
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2013-12-19 20:11:01 +02:00
Andrew Tomaka 0760ba3efb Customization and previewing of broadcast messages 2013-12-18 17:43:45 -05:00
Dmitriy Zaporozhets 201d489780
Annotate
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2013-11-13 14:10:03 +02:00
Dmitriy Zaporozhets c5b667351a
Show broadcast message to users
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2013-11-12 15:08:20 +02:00
Dmitriy Zaporozhets dd501aa7a7
Broadcast messages scaffold in admin area
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2013-11-12 14:28:12 +02:00
Dmitriy Zaporozhets f1ecf53c1e
Broadcast message model + migrations
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2013-11-12 13:47:28 +02:00