Commit graph

428 commits

Author SHA1 Message Date
Mac Siri
afa73e06e3
Replace Webpacker with Esbuild (#20470)
* Migrate to esbuild WIP

* Add exclude

* Remove redundant file

* Move file

* Move to javascript_include_tag

* Lint fix

* WIP

* WIP

* Add watch mode to esbuild WIP

* Get jest working

* Remove babel

* Revert "Remove babel"

This reverts commit 6da35260aa19d6f97f586deb66c0ecaf48433b73.

* More WIP

* Got image to load

* WIP

* Resolve audit

* Lint fix

* WIP

* Fix jest spec

* [CI] Remove asset-restore for test build stage

* Production compliant

* Temp disable sourcemap

* Update glob

* Add esbuild helper to stimulus

* Import fragment

* Temp disable coverage to see failing tests

* Fix broken spec

* Address lint

* Set proper es6 target

* Use esbuild for everything

* wait what

* Revert "Set proper es6 target"

This reverts commit 98f5278093421baa8ffe2ca580845b01c1a1eadf.

* Revert "Use esbuild for everything"

This reverts commit 0ac46738f07ffcb6af095ccb1ffa5e439b7fefa3.

* Replace uglifier with terser

* New compiled assets version

* Remvoe honeybadger-io/webpack

* Remove cypress coverage checks for now

* Update jsconfig.json

* Update docker-compose

* Remove public/packs-test from ci cache
2024-01-25 20:29:21 +00:00
Anna Buianova
ca16a87a47
Upgrade ahoy_matey (#20404)
* Added index to ahoy_visits

* Upgrade ahoy_matey
2023-12-01 14:27:11 +00:00
Ben Halpern
bc89cf3e38
Store browser accept language header on users (#20212)
* Store browser accept language header on users

* Change to tracking via user context

* Remove async info code

* First draft of spec

* Work out tests

* Delete dependents
2023-10-16 11:59:30 -04:00
Mac Siri
5dc7e889b9
Support devcontainers and GitHub codespace (#20126)
Co-authored-by: Josh Klar <jklar@forem.com>
2023-09-21 18:16:09 -04:00
Juanito Fatas
e1c91d2a64
Fix typo of configuring redis at datadog initializer (#20016) 2023-09-11 10:40:04 -04:00
PJ
7be865b295
Feature-flagged support for filtering billboards by location (#19834)
* add migrations

* add countries gem?

* first pass at location model

* specs 

* add location to filtered ads query

* feature flag and nicer errors

* cosmetic fixes

* more tweaks (remove unnecessary index, add initializer)
2023-07-27 18:13:26 +01:00
Mac Siri
cd9d5df963
Set hash_digest_class to SHA256 (#18364) 2023-07-06 17:38:56 -04:00
Mac Siri
d183f8c670
Disable DD's log_injection in development (#19660) 2023-06-30 10:11:52 -04:00
Ridhwana
e67454fa53
Preparation of endpoint and files required for ChatGPT Plugin (#19394)
* feat: add the ./wellknown/ai-plugin.json file

* feat: add a logo

* feat: firts attempt at open_api file with endpoint we thought we'd use

* feat: add a search action to teh articles controller that build up teh appropriate json

* feat: add a query param to the article index

* feat: add some chatgpt endpoints and file paths to CORS

* feat: update the openapi yml file to reflect the article search endpoint

* fix: use the correct concept

* feat: replace the logo

* feat: update the ai-json file

* feat: update the openapi file

* feat: update the api and it's params

* feat: update the search query

* fix: ordering

* feat: cors debug

* fix: logic with markdown

* chore: fix test

* spec: article

* spec: article

* spec: article

* Update public/.well-known/ai-plugin.json

* Update public/openapi.yml

---------

Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
2023-04-27 16:51:24 -04:00
Mac Siri
1e1064de0b
Undo changes to Sprockets::UglifierWithSourceMapsCompressor (#19261) 2023-03-24 12:48:59 -04:00
Anna Buianova
784afdf41e
Routine rubocop fixes (#19254)
* Rubocop fixes

* Rubocop fixes

* Fixed rubocop violation

* Fixed policies rubocop violations

* More rubocop fixes
2023-03-24 14:37:44 +03:00
Mac Siri
140f85695b
Add forgot_password_throttle (#19175) 2023-02-27 09:25:29 -05:00
Joshua Wehner
ea2154d506
Fixing design issues with multiple reactions (#19020)
* Try disabling text-select (mobile long-tap)

* Try to force button color on mobile safari

* Try making notification decorator more helpful

* More using notification decorator

* Helper so I can see exceptions

* As we toggle feature flag, temporary show 'heart' for unsupported reactions

* Reaction on Comment is a 'reaction'-type notification

* Temporarily add new emojis to i18n

* Render full-color, unique SVGs for multiple_reactions

* Restore card layout

* Aggregate reaction icons also need unique SVGs

* This seems unnecessary?

* Multiple is -more-than-one-

* Display *unique* reaction categories on /notifications

* Comment notification no longer needs to re-render as reaction

* Decorator needs to handle some data gaps

* Fix NotificationHelper

* Try a better name for this

* Tests for the notification decorator

* These partials wound up without an outer layer

* Add a descriptive comment

* index needs force_unique

* Try multiple reactions external img (#19076)

* Try external img SVGs

* Unique SVG might not be necessary if this works

* Can also remove this spec if successful

* Restore flash icon behavior

* Plus external img for #index as well
2023-02-08 11:39:47 +01:00
Joshua Wehner
30c0485507
Frontend for multiple reactions (v1) (#18808)
* Remove extraneous comment (see 9361d2 and 5c18f8)

* Flexible, multiple reaction types

* Fix reaction counts

* Re-use svg for active state for now

* Update yml, update spec

* Possible temp fix for failing tests

* Colorize reaction icon svgs

* Reaction engagement above post title

* Index reactions engagements (for logged-out)

* Maybe readinglist is special

* Try using crayons' dropdown as a drawer?

* readinglist isn't really public now

* feat: update the styles for the reaction drawer

* Grey background highlight, turn off border/shadow

* Read our feature flag docs, saw this was recommended

* Missed fifth emoji: party/tada

* Fix JS test errors

* Update test with tada

* Suppress flashing engagements when no public reactions

* Liberate jump-to-comments from unicorn replacement

* 'Add reaction' on tooltip

* Don't show reaction emoji on index unless it's been used

* rubocop

* Update heart+ total count when toggling

* Do not include 'readinglist' in drawer/public counts

* Fix semi-public readinglist so that icon is badged for current user

* Tweak heart-plus svg

* Style tweak: border on active reaction

* Show reacted icon on drawer trigger for 1.5 sec

* Tweak styles for engagements bar

* Style tweaks for multiple engagements (#index)

* Trying to get size working through crayons/inline_svg

* Sparkle hearts

* Restore unicorn

* Make heart-plus-active work when user has an active reaction

* Try 'hoverdown' a dropdown that activates with hover

* Long touch?

* Tap *outside* the drawer to close

* Mobile reaction drawer is also supposed to be columns

* More reaction count cleanup

* Final emoticons maybe?

* Fix reaction bug when feature disabled

* Remove readinglist from public reaction counts

* Update specs for new reaction categories

* Shuffle makes specs flaky

* Order does not matter

* rubocop

* Update to preserve readinglist analytics

* Shuffle makes specs flaky

* Fix flickering images, remove icon highlight for now

* Don't update total for readinglist

* reactions_by_user_id

* Try renaming this observer function

* Try unid ids for SVGs

* Remove local test file

* Simplistic test for the unique svg transform

* Fix javascript for current SVG

* Signifcant string literals in this case, rubocop

* Use the right expected output

Co-authored-by: Ridhwana <ridhwana.khan16@gmail.com>
2023-01-23 16:00:50 +01:00
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
9ab6edb0b8
Opt in settings for Ahoy Tracking (#18575)
* Opt in settings for Ahoy Tracking

* Typo tweak
2022-10-17 10:11:27 -06:00
Mac Siri
0e43c915d9
Silence parser warnings (#18429) 2022-09-09 11:28:43 -04:00
Mac Siri
2413ece281
Use remote_ip in Rack::Attack (2nd attempt) (#18409) 2022-09-06 10:06:29 -04:00
Mac Siri
0ea60867d4
Revert all Rack::Attack changes (#18407) 2022-08-31 18:11:56 -04:00
Mac Siri
05f0e72c24
Simplify Rack::Attack (#18403) 2022-08-31 16:58:34 -04:00
Mac Siri
560bff9403
Move rack_attack.rb (#18402) 2022-08-31 14:28:26 -04:00
Mac Siri
9c0fc6b918
Use remote_ip in Rack::Attack (#18397) 2022-08-31 10:50:26 -04:00
Fernando Valverde
f77b5f83a9
Include audit log for API admin endpoints (#18167)
* First commit for audit log - specs need fixing

* Fix notification subscription issues + specs

* Use single line in notification subscribe initializer

* Remove conditional in unpublish endpoint
2022-07-22 11:35:30 -06:00
Fernando Valverde
aa130cc456
Fix Honeybadger typo in Rpush reflection callback (#18071) 2022-07-13 09:13:40 -06:00
Mac Siri
9599d3349f
Enable framework 7's cache_format_version (#18064) 2022-07-12 15:44:23 -04:00
Mac Siri
5579f3360c
Add DD service name for active_support and active_record (#18060) 2022-07-11 10:14:42 -04:00
Mac Siri
390cf0a6a0
Enable Rails 7 framework's default_headers (#18042) 2022-07-07 09:01:59 -04:00
Mac Siri
294fcba1e0
Add service_name scope to Datadog (#17996)
* Add service_name scope to datadog

* Fix typo

* Update config/initializers/datadog.rb
2022-07-01 11:32:45 -04:00
Mac Siri
9dd52c24e1
Enable Rails 7's framework wrap_parameters_by_default & cookies_serializer (#17984) 2022-06-27 09:33:37 -04:00
Fernando Valverde
8c836430ca
API V1 transition (#17835)
* API Articles v0-v1 restructure

* Remove unused helper

* Bulk move API controllers into concerns + add V1 controllers

* Extract API routes + some fixes

* Fix v1 api_controller authenticate! + add more article_controller specs

* Completed spec/requests/api/v1/articles_spec.rb

* specs up to listings

* All v1 specs except for 9 skips

* mime_types cleanup + authenticate! relocation

Co-authored-by: Fernando Valverde <fernando@visualcosita.com>
2022-06-23 14:26:00 -06:00
Mac Siri
2f029fe896
Enable Rails framework 7.0's isolation_level, partial_inserts, & raise_on_open_redirects (#17970) 2022-06-23 10:30:58 -04:00
Mac Siri
130b47e8b8
Enable Rails framework 7.0's TimeWithZone & scope-inversing (#17958) 2022-06-22 09:33:38 -04:00
Mac Siri
eed1946e8c
Enable Rails framework 7.0's ActionView & tests (#17948)
* Enable Rails framework 7.0's tests configs

* Enable action_view configs
2022-06-16 17:18:21 -04:00
Mac Siri
80d9b969bd
Enable Rails framework 7.0's ActiveStorage & ActionMailer (#17931) 2022-06-16 10:49:56 -04:00
Mac Siri
dc55db5708
Change Rails load_defaults to 6.1 (#17877) 2022-06-13 10:40:53 -04:00
Mac Siri
686be06009
Enable cookies_same_site_protection :lax (#17875) 2022-06-09 16:04:39 -04:00
Mac Siri
a87f70048c
Enable some Rails 6.1 framework default part2 (#17855)
* Enable form_with_generates_remote_forms and deliver_later_queue_name

* Change form_with_generates_remote_forms to true

* Move config to application.rb

* Enable urlsafe_csrf_tokens

* Update comment
2022-06-08 10:56:10 -04: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
Mac Siri
fc9bfda0ce
Enable/remove some Rails 6.1 framework default (#17831)
* Default Rails 6.1's active_record & active_storage config

* Remove active_storage and action_mailbox from 6.1 default
2022-06-07 08:42:10 -04:00
Fernando Valverde
21103696c3
Add missing explicit scopes to Omniauth adapters (#17761)
* Add missing scopes to Omniauth adapters - explicit > implicit

* Trigger CI
2022-05-25 09:56:13 -06:00
dependabot[bot]
17955537e7
Bump ddtrace from 0.54.2 to 1.0.0 (#17662)
* Bump ddtrace from 0.54.2 to 1.0.0

Bumps [ddtrace](https://github.com/DataDog/dd-trace-rb) from 0.54.2 to 1.0.0.
- [Release notes](https://github.com/DataDog/dd-trace-rb/releases)
- [Changelog](https://github.com/DataDog/dd-trace-rb/blob/master/CHANGELOG.md)
- [Commits](https://github.com/DataDog/dd-trace-rb/compare/v0.54.2...v1.0.0)

---
updated-dependencies:
- dependency-name: ddtrace
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Apply configurationa update

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mac Siri <krairit.siri@gmail.com>
2022-05-18 15:46:49 -04:00
Mac Siri
215bf4abe6
Update datadog.rb to include env scope (#17667) 2022-05-12 18:13:20 -04:00
Mac Siri
fc188a0759
Simplify ddtrace configuration (#17665) 2022-05-12 15:19:47 -04:00
Mac Siri
8d39d22d9e
Revert "Bump ddtrace from 0.54.2 to 1.0.0 (#17560)" (#17643)
This reverts commit eeed96cf9c.
2022-05-12 09:28:50 -04:00
dependabot[bot]
eeed96cf9c
Bump ddtrace from 0.54.2 to 1.0.0 (#17560)
* Bump ddtrace from 0.54.2 to 1.0.0

Bumps [ddtrace](https://github.com/DataDog/dd-trace-rb) from 0.54.2 to 1.0.0.
- [Release notes](https://github.com/DataDog/dd-trace-rb/releases)
- [Changelog](https://github.com/DataDog/dd-trace-rb/blob/master/CHANGELOG.md)
- [Commits](https://github.com/DataDog/dd-trace-rb/compare/v0.54.2...v1.0.0)

---
updated-dependencies:
- dependency-name: ddtrace
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update config file for 1.0:

* Use Tracer class for 1.0

* Re-enable priority sampling

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Josh Puetz <hi@joshpuetz.com>
2022-05-05 06:57:43 -06:00
Ridhwana
e72957a913
feat: add an inflection and change instances of gdpr to GDPR (#17567) 2022-05-04 16:20:46 +02:00
Daniel Uber
4d33486e14
Enable string uuid as namespace (#17309)
* Enable string uuid as namespace

This addresses a noisy deprecation warning showing in specs (it points
to our re-implementation of warden's sign_in_as helper, but I suspect
the issue is within warden since our initializer seems to match the
implementation in the upstream gem).

My understanding of this is that the prior default had been to pass
the provided uuid namespace as-is if it didn't match one of a few
named constants. New behavior is to validate that any string provided
as a namespace looks like a uuid representation or fail).

* Move configuration change to framework defaults
2022-04-20 10:24:25 -05:00
Arit Amana
5cf2229b58
Better Error Msg when Listing URL embedded and Listings are disabled (#17116)
* complete implementations and specs

* remove unused error msgs

* add "listing" and "listings" as ReservedWords
2022-04-06 08:38:53 -04:00
Michael Kohl
33195929aa
Bump to Rails 7.0.2.2 MVP (#15908)
* Update gems

* Update more gems

* Update @rails/ujs package

* Explicitly add sprockets-rails

* Gemfile update

* Run bin/rails app:setup

* Update redis-actionpack

* Update stats initializer autoloading

* Update acts-as-taggable-on

* Disable signed: true option in session store

* Switch back to released version of redis-actionpack

* Update Gemfile.lock

* WIP

* Update Rails and gems

* Move hair_trigger back to released gem

* Add explicit requires to initializers

* Update Rails version

* Add more explicit require_relative calls

* Re-enable ForemStatsDriver

* Update schema

* Temp spec changes

* Bullet started raising errors?

* Fix broken spec

* Temporarily disable hair_trigger_spec

* Refactor

* Fix spec

* Enable use_rfc4122_namespaced_uuids

* Revert "Enable use_rfc4122_namespaced_uuids"

This reverts commit 5dac3722284bb08049586bfa943405f8a01289df.

* Temporarily deploy to canary

* Revert "Temporarily deploy to canary"

This reverts commit 04f8469501fab2a3177450baf051ff6259c41827.

* Update Containerfile

* Add comments to specs

Co-authored-by: Mac Siri <krairit.siri@gmail.com>
2022-03-30 15:00:33 -04:00