Commit graph

725 commits

Author SHA1 Message Date
Joshua Wehner
3f26694976
Refactor reaction categories as abstract class collection (#18540)
* Try a ReactionCategory abstract 'model'

* Use ReactionCategory

* Lookup category, pre-reaction

* Lookup category > constant

* Category can sometimes be nil?

* Try something friendlier for code reloading

* Refactor: extract point calculation out of Reaction

* Reaction Category can have color

* Rename reaction points service to follow convention

* method signature changed as well, calculate -> call

* Fix typo, leading comment, and rename data structures for clarity
2022-11-01 10:50:37 +01:00
Fernando Valverde
2517a4dac9
Remove rack attack throttle for admin users in API requests (#18612)
* remove rack attack throttle for admin users

* Add tests

* Optimize cache admin secrets for 24h with invalidation when needed

* Make ApiSecret callback only execute on create
2022-10-25 09:26:38 -06:00
Fernando Valverde
d14d882b13
Make reason for adjustment optional in moderator tag adjustment (#18606)
* Makes reason for adjustment optional for mod tag adjustments

* Makes reason for adjustment in notification conditional on adjustment reason

* Fix cypress element lookup by placeholder text
2022-10-20 09:54:52 -06:00
Joshua Wehner
1fcafbbd41
Rollup service to compact DisplayAdEvent records (#18508)
* Restore DisplayAdEvents.counts_for

* Try a rollup service for DisplayAdEvent

* Schedule daily rollup worker for one month prior

* Refactor aggregator

* More testing for rollup

* Add test for rollup attribute fidelity

* DisplayAd success_rate based on counts_for
2022-10-19 16:21:47 +02:00
Ben Halpern
ef63738454
Feed experiment for 10-11-2022 (#18566) 2022-10-11 08:56:49 -06:00
Fernando Valverde
5caca502d3
ActiveSupport::Notifications listen/forget fix (#18549)
* active support notifications debug

* Match missing .forget listeners
2022-10-07 11:00:37 -06:00
Anna Buianova
9d755a9d2f
Save list of previously-published articles when user is subject to an "un-publish all" action (#18535)
* Moved logging and deleting comments to Moderator::UnpublishAllArticlesWorker

* Added logging for admin action (unpublish_all_articles)

* Extracted code from UnpublishAllArticlesWorker to the service

* Make it possible to add a note while unpublishing all via admin action

* Added ability to add notes for unpublishing all from moderator action panel

* Fixed setting slug for the AuditLog on unpublishing + spec
2022-10-06 14:17:20 +03:00
Ridhwana
36f5d168d8
✂️✂️✂️ Part 2: Remove Sponsorship (#18522)
* feat: remove initializeSponsorshipVisibility and related code

* feat: remove sponsorships from sidebar

* feat: remove sponsorships from the admin - route, controller, view, spec

* feat: remove the admin menu item

* feat: remove the i8n for admin sponsors controller

* feat: sponsorship decorator was not being used anywhere

* feat: sponsorship slack messenger was not being used anywhere

* feat: remove the sponsorship_headline that gets configures on the admin

* feat: remove the /sponsors page

* feat: remove renedring of single_sponsor partial and associated partials

* feat: remove the navigation link rake task for sponsors

* feat: remove sponsorship from tags

* feat: remove i8n constants used

* remove sponsor references in text to the privacy page

* feat: remove the sponsorship detail from the organization page

* feat: remove the sponsors css that was used for app/views/pages/sponsors.html.erb

* feat: remove the sponsorship i8n that was used in the slack messengers

* feat: swap out the decorators to use Article as an example

* feat: remove spec to show sponsors on home page

* feat: update the specs to use Article Decorator instead of the Sponsorship Decorator

* fix: use direct and not all

* fix: remove tests for tag sponsorship

* fix: remove organization sponsorship test

* feat: remove more i8n

* remove unused css from app/views/organizations/_sidebar_additional.html.erb

* feat: remove sponsorship relationship from tag and organization

* remove seed

* feat: remove all Sponsor related specs

* feat: remove model, associated i8n and specs

* feat: remove sponsor from navbar

* feat: add a guard clause if we're unable to constantinize the purchase_type

* feat; remove sponsorship related tests

* feat: remove sponsorship relationship

* feat: remov especs related to sponsorship

* feat: remove tag sponsorship validation

* feat: remove the sponsorship factory
2022-10-04 19:02:44 +02:00
Ridhwana
9361d2426f
✂️✂️✂️ Part 1: Remove Sponsorship (#18512)
* feat: remove initializeSponsorshipVisibility and related code

* feat: remove sponsorships from sidebar

* feat: remove sponsorships from the admin - route, controller, view, spec

* feat: remove the admin menu item

* feat: remove the i8n for admin sponsors controller

* feat: sponsorship decorator was not being used anywhere

* feat: sponsorship slack messenger was not being used anywhere

* feat: remove the sponsorship_headline that gets configures on the admin

* feat: remove the /sponsors page

* feat: remove renedring of single_sponsor partial and associated partials

* feat: remove the navigation link rake task for sponsors

* feat: remove sponsorship from tags

* feat: remove i8n constants used

* remove sponsor references in text to the privacy page

* feat: remove the sponsorship detail from the organization page

* feat: remove the sponsors css that was used for app/views/pages/sponsors.html.erb

* feat: remove the sponsorship i8n that was used in the slack messengers

* feat: swap out the decorators to use Article as an example

* feat: remove spec to show sponsors on home page

* feat: update the specs to use Article Decorator instead of the Sponsorship Decorator

* fix: use direct and not all

* fix: remove tests for tag sponsorship

* fix: remove organization sponsorship test

* feat: remove more i8n
2022-10-03 16:26:32 +02:00
Joshua Wehner
98077a8df6
DisplayAdEvent tracking changes (#18460)
* Make user_id optional for DisplayAdEvent

* Track when DisplayAd is visible to user

* Tidy up a bit

* Deleting a user account should nullify related DisplayAdEvents

* Update tests with new association details
2022-09-26 16:33:03 +02:00
Fernando Valverde
bebd1d459c
Remove brand_color2 from users_settings (#18473)
* Remove brand_color2 from users_settings

* Remove occurences of brand_color2
2022-09-21 11:21:29 -06:00
Joshua Wehner
2b24167fba
Try fixing comment like count bugs (#18438)
* Try fixing comment like count bugs

* Tests for the CommentCreator
2022-09-12 10:12:46 +02:00
Joshua Wehner
2ff67bda24
Try an idempotentish reaction create API (#18377)
* Try an idempotentish reaction create API

* Add tests for create API endpoint

* Try -> ReactionHandler

* Fix existing tests first

* Tests for .toggle; fix broken handle_existing

* Use the Handler

* Tweak http status for reaction create

* Use the category reader

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
2022-08-30 16:43:18 +02:00
Anna Buianova
6ef1968377
Made published_at immutable after an article has been published once (#18384)
* Don't change published_at for articles that have already been published (even if unpublished later)

* Removed unused code related to changing published_at

* Added specs for updating published_from_feed articles, fixed specs

* Removed old validation

* Added specs for article validation published_from_feed

* Added and reorganized specs for the Article model (setting published_at)

* Remove the commented code, added a spec

* Added specs for unpublishing

* Removed unused update_published_at from article attributes spec

* Fixed nullifying published_at seconds when republishing from rich editor
2022-08-30 11:32:06 +03:00
Anna Buianova
a4ffb7cac3
Allow published_at to be within 15 minutes, not 15 hours (#18345)
* Allow published_at to be within 15 minutes, not 15 hours

* Fixed creating past articles in the specs

* Fixed one more spec with a past article

* Use ActiveSupport's helper instead of computation

Co-authored-by: Fernando Valverde <fernando@fdo.cr>

Co-authored-by: Fernando Valverde <fernando@fdo.cr>
2022-08-22 12:48:40 +03:00
Mac Siri
e358fdf347
Revert "Nullify published_at when unpublishing an article (#18298)" (#18353) 2022-08-18 13:58:58 -04:00
Joshua Wehner
3f6cc95f79
Try context-based sorting for username search (#18311)
* Try context-based sorting for username search

* Use the search

* Comment cleanup

* Working on specs for new context behavior

* Front-end provides context

* Try refactoring away from class-level methods

* Comments don't always have context

* Try refactor query to avoid joins and get under timeout

* If we stub the request, the tests might work

* Cleanup unused join fragments
2022-08-18 17:08:46 +02:00
Anna Buianova
414e17aca6
Nullify published_at when unpublishing an article (#18298)
* Remove context_notifications when unpublishing all posts

* Nullify published_at when unpublishing an article
2022-08-15 20:59:20 +03:00
Joshua Wehner
445fd0f9e5
Try renaming moderator -> super_moderator (#18261)
* Try renaming moderator -> super_moderator

* Still finding 'moderator' words

* Fixes for failing specs

* Update test with new role name

* Update app/services/moderator/manage_activity_and_roles.rb

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2022-08-10 16:43:30 +02:00
Anna Buianova
a00468633f
Fixed sending slack notifications for published articles (#18272) 2022-08-08 09:04:22 +03:00
Jeremy Friesen
5296b6c4b4
Adding configurations to tighten spam handling (#18195)
This is a draft highlighting a proof of concept to allow for each Forem
to add tighter enforcement of spam.

Related to forem/forem-internal-eng#453
2022-08-01 11:21:34 -04:00
Jeremy Friesen
427cec341c
Adding conditional spam handling for user profile (#18158)
* Adding conditional spam handling for user profile

Prior to this commit, we always checked the user's name for spam
matching criteria.  With this change, we're allowing a site
administrator to toggle on a feature flag for more rigorous profile
checking.

The reason for the increased rigor is that there could be unexpected
consequences (e.g. marking a user as spam who was previously not caught
as a spammer).  If you want the feature, enable the
`:more_rigorous_user_profile_spam_checking` flag.

Closes forem/forem#18157
Related to forem/forem-internal-eng#453

* Adding additional test case

* Update spec/services/spam/handler_spec.rb

Co-authored-by: Fernando Valverde <fernando@visualcosita.com>

Co-authored-by: Fernando Valverde <fernando@visualcosita.com>
2022-07-20 11:36:10 -04:00
Fernando Valverde
a4a8e7798b
Devise skip_confirmation on authenticator service (#18169)
* Devise skip_confirmation on authenticator service

* remove unless

* Remove confirmed? related specs

* Remove confirmed? related specs
2022-07-20 07:26:26 -06:00
Mac Siri
54f3d704fe
Add timeout to GetMediaUrl's HTTParty (#18136) 2022-07-15 17:33:44 -04:00
Jeremy Friesen
0ef5bc6351
Ensuring we delete podcasts when we banish a user (#18063)
Prior to this commit, we may have left lingering podcast entries that
required manual cleanup.  As a bonus, I also added deleting podcasts
when we delete users.

Closes forem/forem#18041

In addition I adjusted rubocop to not complain about the require method call

```
spec/services/users/delete_spec.rb:1:1: C: \
  Style/TopLevelMethodDefinition: \
  Do not define methods at the top-level. \
  (https://rubystyle.guide#top-level-methods)
require "rails_helper"
^^^^^^^^^^^^^^^^^^^^^^
```
2022-07-12 09:18:06 -04:00
Fernando Valverde
b8abbda72e
Unpublish post service class + V1 API endpoint (#18031)
* Unpublish post service + API

* Apply PR feedback

* Use module_function on service class
2022-07-08 09:08:55 -06:00
Anna Buianova
ff76cdd3c5
Scheduling articles (#17939)
* Article query spec for scheduled articles

* Added scheduled article badge on the user dashboard

* Added published_at field to editor options

* Accept and validate published_at from editor

* Refactor published_at validation

* Allow 1-minute difference in published_at

* Notice on an unpublished article page

* Added specs for 'Click to edit' link on scheduled article preview page

* ContextNotification model

* Articles::Publish worker

* Added specs for articles publish worker

* Schedule publish articles worker

* Added tests to check for scheduled posts in feeds

* Don't allow managing scheduled articles

* Don't send notifications for scheduled articles

* Set published_at in Articles::Updater when publishing

* Published_at value in post options

* Pass timezone and set published_at accordingly

* Limit setting published_at to the future

* Readonly published_at for articles that were already published

* Chagning published_at format in editor v1 (start)

* Changed published_at format in frontmatter, specs

* Added specs for updating published_at from frontmatter

* Fixed accepting past published_at for articles published_from_feed

* Enabled published_at validation: don't allow updating published_at for already published articles

* Validate published_at on create

* Added a spec for updating published_at for exported articles

* Fixed specs related to creating articles with past published_at

* Fixed specs related to past published_at for articles

* Added a hack so that admins would be able to update published_at

* Switch button text schedule/publish when changin publishedAt

* Fixed saving published_at with timezone

* Added a feature flag for scheduling articles

* Default text in markdown editor depends on feature flag

* Enable article editor cache again

* Fixed the default value in the markdown editor

* Fix sitemaps spec

* Removed tooltip

* Fixed articles update specs

* Added missing locales

* Fixed article create specs

* Fixed spec

* Removed commented code

* Returned enabling extensions in the schema

* Returned accidentally deleted constraint

* Make articles query spec more stable

Co-authored-by: Jeremy Friesen <jeremy.n.friesen@gmail.com>

* Removed commented code

* Removed unused code

* A clearer policy

Co-authored-by: Jeremy Friesen <jeremy.n.friesen@gmail.com>

* Use StringInquirer for article current state

* Added a note and todo to articles factory past trait

* Remove duplicated PropType

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Refactor query in the Articles::PublishWorker

Co-authored-by: Mac Siri <krairit.siri@gmail.com>

* Refactor articleForm.jsx

Co-authored-by: Mac Siri <krairit.siri@gmail.com>

* Removed specs that are no longer relevant

* Removed useless onKeyUp on a hidden input

* Refactored articleForm

* Hide scheduling from post options when published_at is readonly

* Run sends notifications worker every 5 minutes instead of every minute

Co-authored-by: Jeremy Friesen <jeremy.n.friesen@gmail.com>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
Co-authored-by: Mac Siri <krairit.siri@gmail.com>
2022-07-07 17:32:49 +03:00
Joshua Wehner
5e916b74c1
Possibly fixes style injection? (#18053)
See https://github.com/forem/forem-internal-eng/issues/480
2022-07-07 16:05:33 +02:00
Fernando Valverde
1eafd7388e
Fix email confirmation logic when registering via Omniauth (#17878)
* Move .skip_confirmation! call to .find_or_create_user! method

* Add regression tests to avoid email confirmation delivery

* Keep the original place where we had user.skip_confirmation! too

* Update logic to require email confirmation from omniauth

* test confirmation is required with SMTP

* Keep :notice instead of :global_notice

* Forem Account bypass email confirmation reorg

* inline comment reorder + clarification

* Apply suggestions from code review

Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>

Co-authored-by: Fernando Valverde <fernando@visualcosita.com>
Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
2022-06-23 16:26:26 -04:00
Suzanne Aitchison
26077f3e1f
Rename base_roles ui labels (#17938)
* rename base_roles ui labels

* update some specs

* fix missed strings in cypress spec
2022-06-21 16:17:35 +01:00
Mac Siri
678dda8cf4
Routine Rubopcop lint fixes (#17844)
* Routine Rubopcop lint fixes

* Undo app_secrets_spec changes

* Fix broken spec
2022-06-07 10:17:16 -04:00
Andy Zhao
103394d5ad
Add tooltip to cover image button describing optimal image ratio (#17779)
* Add tooltip for cover image button

* Add cover img tooltip to v1 editor

* Use a slightly different message

* Fix tests

* Use proper comment syntax for front matter

* Fix Cypress test

* Use regex to find matching label
2022-06-02 17:44:34 -04:00
Dwight Scott
8b70e9e1f3
added ability to assign moderator role via admin/super admin (#17759)
* added ability to assign moderator role via admin/super admin

* create Mod User in seeds

* add Cypress specs

* fix failing Cypress tests

* fix failing specs by moving test Mod user to the end

* nudge Travis

* nudge Travis

Co-authored-by: Arit Amana <msarit@gmail.com>
2022-05-26 10:57:08 -04:00
Fernando Valverde
8160089f3d
Remove Community Wellness badge feature flag (#17623)
* Remove feature flag

* Remove tracking spec

* Add rollout date restriction logic + specs
2022-05-11 12:08:40 -06:00
Fernando Valverde
bf4d34fe9c
Wellness badge query+service refactor (#17592)
* Query +service slight refactor

* 33 week comment
2022-05-09 16:44:50 -06:00
Jeremy Friesen
43a9c5f2f0
Fixing variant query specs (#17597)
* Fixing variant query specs

As I was working on adding a new variant, I discovered that not all of
our variants were being tested.  This had to do with a faulty assumption
regarding the scoping of the `variant` local variable.

The change ensures that we declare a subject once for each defined
variant within their own `describe` block.  Without that `describe`
block, you end up repurposing the same subject.

I found this because I made a deliberate error in the upcoming variant
and checked the tests.  They passed.

Related to forem/forem#17584

* Update spec/services/articles/feeds/variant_query_spec.rb

Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>

* Update spec/services/articles/feeds/variant_query_spec.rb

Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>

Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
2022-05-09 13:20:34 -04:00
Fernando Valverde
010e0fc2db
Replace Ahoy metric logging with ForemStatsClient on Community Wellness Badge service (#17542)
* ForemStatsClient.increment

* Include ForemStatsClient check on spec

* Update app/services/badges/award_community_wellness.rb
2022-05-03 09:31:38 -06:00
Daniel Uber
b2c7f7a5a3
Use Sidekiq::Job module alias for Sidekiq::Worker (#17526) 2022-05-02 11:12:58 -05:00
Fernando Valverde
c4df397fef
Community Wellness badge (#17394)
* First greedy algorithm approach to awarding community wellness badge

* Update app/services/badges/award_community_wellness.rb

I'm sorry I ignored you rubocop. It's still on draft for a reason 😅

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update app/services/badges/award_community_wellness.rb

Okay, whatever you say rubocop. This line will go away before merging anyways

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Use app/queries/comments/community_wellness_query.rb to replace greedy algorithm

* Query indenting + rename positive_reactions to negative_reactions in EXCEPT

* First step towards query spec

* Fix spec and make it more robust

* Slight cleanup/tweaks

* Badge reward & message

* copy edits + spec improvements + 3 days ago min for query

* Cron update to run daily + small tweak for FeatureFlag use

* inline comment tweaks

* Slight reorder of guard checks in service (FeatureFlag related)

* PR review feedback

* Fix specs from static method refactor

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-04-29 12:38:40 -06:00
Daniel Uber
913ca720a8
Don't create podcast episodes without any media (#17449)
* Don't create podcast episodes without a media_url

There is an early return from add_media_url to prevent using an empty
enclosure_url, which avoids errors in
`GetMediaUrl.call(a_blank_value)`, however there's also a not null
constraint on podcast_episodes.media_url in the database, which causes
upsert to raise an error.

Returning early here avoids the error (which had halted the worker).

See also
https://app.honeybadger.io/projects/66984/faults/80833402

This error happens regularly, 96 times per day in DEV, it looks like at least
one podcast feed_url is for an rss feed filtered by /tag/podcast/,
(and at least one post was tagged "podcast" but didn't include any
media to get).

My understanding is at worst we'll ignore the error silently.

* Add test cases

given a blog post (not a podcast episode, no media url), don't raise
any error, don't create any episode.

Included codepunk.io feed that was showing this issue initially.
2022-04-27 11:21:03 -05:00
Jeremy Friesen
4bc181503f
Removing WeightedQueryStrategy; use VariantQuery now (#17420)
You had a good ride, but your successor, the
`Articles::Feeds::VariantQuery`, is doing well in production.  And has
been for quite awhile.

You helped us get to a better spot in regards to the feed algorithm, but
your time has come to rest as a memory in our git history.
2022-04-27 09:19:09 -04:00
Andy Zhao
0fca6a6f35
Permanently delete users from Mailchimp automatically (#17395)
* Rename unsubscribe to remove_from_mailchimp_newsletters

* Permanently delete from mailchimp instead of unsubscribing

* Rename method and remove comment

* Don't use i18n because of error message

We don't want to use i18n here because e.title comes from the error response. If a Forem
was using a different locale and Mailchimp for newsletters, they would still receive the
error response in English (because of Mailchimp).

* Refactor and rename a bit

* Rename methods in tests accordingly

* Remove now moot test

* Rename method in other places it was previously called

* Remove unused translation, see 62fee247ee2565e4d3d14919a8636a76ce5ecc9f

* Fix typo and report error if not 404
2022-04-26 09:48:50 -04:00
Jeremy Friesen
8b37e3aca9
Tidying up the Articles::Feeds::VariantQuery (#17396)
This commit does three things:

1.  Breaks the inheritance of the VariantQuery.
2.  Revisits the in-line documentation to better reflect current state.
3.  Removes branching logic that we don't need.

My goal is to have a VariantQuery that is what we need, conforms to the
method interface of WeightedQueryStrategy but does not rely on it.

After we merge this, we can observe if things break on DEV and fallback
to WeightedQueryStrategy if this doesn't work.  Once the
`Articles::Feeds::VariantQuery` has fledged on it's own, we can remove
the feature flag and then finally remove the weighted query strategy.

But that's the future steps.

Related to forem/forem#17393
2022-04-22 15:26:37 -04:00
Jeremy Friesen
0d0464be2f
Allowing VariantQuery for Feed Generation (#17382)
* Allowing VariantQuery for Feed Generation

Apologies for the breadth of this pull request, I had considered many
small commits, but felt that would've been more effort for the value
provided.

This commit includes the following:

- Documentation updates to the feed variant (though not the final pass)
- Renaming and adding RelevancyLevers that help differentiate
- Adding RelevancyLever#range to provide documentation
- Reducing redundent controller logic by making a
  `Articles::Feeds.feed_for` method.
- Adding some configuration validation for RelevancyLevers
- Adding constants for better clarification
- Testing unhappy paths for feed configuration
- Adjusting the module namespace of some objects
- Exposing top-level configurations for variants (along with their
  defaults)
- Creating the VariantyQuery that at present inherits from the
  `Articles::Feeds::WeightedQueryStrategy`

As implemented, we can deploy this code to production without using the
new VariantQuery.  Once we toggle on the
`:feed_uses_variant_query_feature` FeatureFlag, it will switch to using
the VariantQuery.  The VariantQuery's two variants and the
internal configuration of `Articles::Feeds::WeightedQueryStrategy`
produce the same query.

The goal of this factor is to allow for a quick on and off toggle of the
feed query; to ensure that what we introduce remains performant.

- Closes forem/forem#17272
- Closes forem/forem#17276
- Closes forem/forem#17216

In addition, I will be recording a code-walkthrough and linking that
recording to the pull request.

* Apply suggestions from code review

Co-authored-by: Mac Siri <krairit.siri@gmail.com>

Co-authored-by: Mac Siri <krairit.siri@gmail.com>
2022-04-21 11:07:09 -04:00
Anna Buianova
05d0464a78
Context Notifications (#17243)
* ContextNotification model

* Create and destroy context notifications when notifications are sent/unsent

* Added a transaction when creating notifications and context notifications

* Documentation for context notifications
2022-04-18 10:30:30 +03:00
Daniel Uber
b05d14dfcd
Update builder spec variable names (#17302)
* Update article builder spec

In #16536 the tests were updated to match a change in the
logic (rather than "needs authorization" the response was "store
location", and we checked for those values).

In #17294 we re-adjusted the meaning of the second returned value from
Articles::Builder.call, and the call sites now label the second value
as "needs_authorization" again.

Restore the same name to the call sites in the spec, and simplify the
example descriptions (this might be a mistake).

* Restore long example descriptions

This restores the names of the test cases to the original.
2022-04-15 09:44:14 -05:00
Jeremy Friesen
3a37db7b30
Ensuring /new remains a call to action end point for DEV (#17294)
There are two problems engrained in this:

1. The undocumented expectation of `/new` needed to other sites linking
with prefill information.
2. The prefill parameters being lost during the authentication process.

The first bug was introduced as part forem/forem#16536.  The second is
likely introduced as part of a Rails upgrade (namely `request.path` most
likely once included the query parameters but with our current
implementation it does not).

Closes forem/forem#17292
2022-04-14 14:50:40 -04:00
Daniel Uber
6e08c7ca14
Disable flakey admin charts spec (#17165)
* Disable flaky test cases

These two tests (counting the number of items returned by the service
in the past week) depend on synchronizing the database time with the
process time, and fail when zonebie is active and the current timezone
is more than 12 hours ahead of UTC ("Samoa" for example fails).

* Use UTC times when calculating the periods for overview charts

The database will use UTC to calculate DATE() for grouping, and
ensuring the same time used when filtering avoids issues where the
ruby/server time and the database time are in distinct timezones, and
posts are published on different days in the two instances.

* Remove unused test-side date helper

* Revert "Use UTC times when calculating the periods overview charts"

This just moved the problem to the request specs. Since the spec is
still failing it's better to get the test suppressed while a fix is
determined

This reverts commit cbad78efcee9df51fd4f0a5214d00358c5253167.
2022-04-11 13:23:47 -04:00
Daniel Uber
7f1fdc7324
Produce a meaningful slug from podcast episode title (#17184)
* Use sluggerize to produce a slug from podcast episode title

This is essentially the process we use for Article#title_to_slug
without the random trailing bits on the end (since podcast episodes
had not worked that way previously).

* Add test case for slug generation

* Oh, the test only works if you checkin the fixture, too
2022-04-08 16:30:16 -05:00
Mac Siri
d28aa37ed2
Add Oauth check to AwardContributorFromGithub (#17155)
* Add oauth check to AwardContributorFromGithub

* Add spec

* Simplify spec
2022-04-06 15:41:20 -04:00