Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: forem/forem
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: codeclimate/forem
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.

Commits on Nov 7, 2022

  1. added .env files

    RJ Robinson committed Nov 7, 2022
    Copy the full SHA
    f85452c View commit details
  2. added logo

    RJ Robinson committed Nov 7, 2022
    Copy the full SHA
    4359cdb View commit details
  3. updated yarn

    RJ Robinson committed Nov 7, 2022
    Copy the full SHA
    2e1ce4d View commit details
  4. redid the honeybadger thing?

    RJ Robinson committed Nov 7, 2022
    Copy the full SHA
    f1c3106 View commit details
  5. redid the honeybadger thing? again

    RJ Robinson committed Nov 7, 2022
    Copy the full SHA
    1ea435f View commit details
  6. bump

    RJ Robinson committed Nov 7, 2022
    Copy the full SHA
    d1567ba View commit details
  7. yarn.lock

    RJ Robinson committed Nov 7, 2022
    Copy the full SHA
    1641e6c View commit details
  8. hypershiepd magic

    RJ Robinson committed Nov 7, 2022
    Copy the full SHA
    f30d340 View commit details
  9. hypershiepd magic engaged

    RJ Robinson committed Nov 7, 2022
    Copy the full SHA
    62b129c View commit details
  10. hypershiepd magic engaged

    RJ Robinson committed Nov 7, 2022
    Copy the full SHA
    3fd04fe View commit details
  11. fastly

    RJ Robinson committed Nov 7, 2022
    Copy the full SHA
    e7bb4cc View commit details
  12. fastly

    RJ Robinson committed Nov 7, 2022
    Copy the full SHA
    0fcb83a View commit details
  13. fastly

    RJ Robinson committed Nov 7, 2022
    Copy the full SHA
    50e6c81 View commit details

Commits on Nov 8, 2022

  1. Remove honeybadger

    Ronney Bezerra authored and Ronney Bezerra committed Nov 8, 2022
    Copy the full SHA
    2907d24 View commit details
  2. Copy the full SHA
    f24ffc2 View commit details
  3. Merge pull request #1 from codeclimate/hackathon

    Remove Honeybadger
    ronneyluan authored Nov 8, 2022
    Copy the full SHA
    b46636b View commit details
  4. Copy the full SHA
    a0bdbac View commit details
  5. Drop dash limitation

    filipesperandio committed Nov 8, 2022
    Copy the full SHA
    f15179e View commit details
  6. Copy the full SHA
    f57a01c View commit details

Commits on Nov 9, 2022

  1. Merge pull request #3 from codeclimate/fe/find-or-create

    Drop dash limitation
    RubyBrewsday authored Nov 9, 2022
    Copy the full SHA
    5f795d6 View commit details
  2. Copy the full SHA
    dc0204a View commit details
  3. Merge pull request #4 from codeclimate/revert-3-fe/find-or-create

    Revert "Drop dash limitation"
    RubyBrewsday authored Nov 9, 2022
    Copy the full SHA
    6aba2fe View commit details

Commits on Nov 17, 2022

  1. Copy the full SHA
    abeeaef View commit details
Showing with 105 additions and 199 deletions.
  1. +2 −2 .env_sample
  2. +1 −2 Gemfile
  3. +0 −2 Gemfile.lock
  4. +5 −0 app/assets/images/code-climate-svg.svg
  5. +0 −14 app/assets/javascripts/base.js.erb
  6. +0 −4 app/assets/javascripts/utilities/getCsrfToken.js
  7. +0 −10 app/controllers/omniauth_callbacks_controller.rb
  8. +1 −5 app/controllers/video_states_controller.rb
  9. +0 −1 app/javascript/article-form/components/ImageUploader.jsx
  10. +0 −1 app/javascript/githubRepos/__tests__/githubRepos.test.jsx
  11. +0 −1 app/javascript/githubRepos/githubRepos.jsx
  12. +4 −10 app/javascript/mobile/foremMobile.js
  13. +0 −1 app/javascript/onboarding/components/ProfileForm.jsx
  14. +6 −15 app/javascript/packs/base.jsx
  15. +0 −3 app/javascript/packs/runtimeBanner.jsx
  16. +0 −4 app/javascript/profileDropdown/flagButton.js
  17. +0 −1 app/javascript/sidebar-widget/SidebarWidget.jsx
  18. +0 −5 app/javascript/utilities/http/csrfToken.js
  19. +0 −3 app/javascript/utilities/sendFollowUser.js
  20. +0 −2 app/lib/release_phase_notifier.rb
  21. +0 −2 app/services/broadcasts/welcome_notification/generator.rb
  22. +0 −2 app/services/edge_cache/bust.rb
  23. +0 −1 app/services/payments/customer.rb
  24. +5 −1 app/views/layouts/_logo.html.erb
  25. +0 −3 app/views/layouts/_user_config.html.erb
  26. +0 −2 app/views/notifications/_notifications_list.html.erb
  27. +0 −3 app/views/notifications/index.html.erb
  28. +1 −17 app/views/pages/robots.text.erb
  29. +0 −2 app/workers/data_update_worker.rb
  30. +1 −6 app/workers/emails/send_user_digest_worker.rb
  31. +0 −1 app/workers/moderator/banish_user_worker.rb
  32. +0 −1 app/workers/moderator/sink_articles_worker.rb
  33. +0 −2 app/workers/organizations/delete_worker.rb
  34. +0 −2 app/workers/users/delete_worker.rb
  35. +9 −0 config/environments/production.rb
  36. +0 −55 config/initializers/honeybadger.rb
  37. +0 −3 config/initializers/rpush.rb
  38. +1 −1 db/seeds.rb
  39. +9 −2 lib/tasks/app_initializer.rake
  40. +1 −1 package.json
  41. +1 −1 release-tasks.sh
  42. BIN vendor/cache/honeybadger-4.12.2.gem
  43. +58 −5 yarn.lock
4 changes: 2 additions & 2 deletions .env_sample
Original file line number Diff line number Diff line change
@@ -69,8 +69,8 @@ NODE_ENV="development"

# Honeybadger for error tracking
# (https://docs.honeybadger.io/lib/ruby/getting-started/introduction.html)
HONEYBADGER_API_KEY="Optional"
HONEYBADGER_JS_API_KEY="Optional"
HONEYBADGER_API_KEY="hbp_qR6oF8uTHgJXJIXRtLyfude9EWR9rE0Mo5PK"
HONEYBADGER_JS_API_KEY="hbp_qR6oF8uTHgJXJIXRtLyfude9EWR9rE0Mo5PK"

# AWS for images storages
AWS_ID=
3 changes: 1 addition & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -42,8 +42,7 @@ gem "front_matter_parser", "~> 1.0" # Parse a front matter from syntactically co
gem "gemoji", "~> 4.0.0.rc3" # Character information and metadata for standard and custom emoji
gem "gibbon", "~> 3.4" # API wrapper for MailChimp's API
gem "hairtrigger", "~> 0.2.25" # HairTrigger lets you create and manage database triggers in a concise, db-agnostic, Rails-y way.
gem "honeybadger", "~> 4.12" # Used for tracking application errors
gem "honeycomb-beeline", "~> 2.11.0" # Monitoring and Observability gem
gem "honeycomb-beeline", "~> 2.11.0" # Monitoring and Observability gHONEem
gem "html_truncator", "~> 0.4" # Truncate an HTML string properly
gem "httparty", "~> 0.20" # Makes http fun! Also, makes consuming restful web services dead easy
gem "httpclient", "~> 2.8.3" # Gives something like the functionality of libwww-perl (LWP) in Ruby
2 changes: 0 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -363,7 +363,6 @@ GEM
thor
highline (2.0.3)
hkdf (0.3.0)
honeybadger (4.12.2)
honeycomb-beeline (2.11.0)
libhoney (>= 1.14.2)
html_tokenizer (0.0.7)
@@ -1004,7 +1003,6 @@ DEPENDENCIES
guard (~> 2.18)
guard-rspec (~> 4.7)
hairtrigger (~> 0.2.25)
honeybadger (~> 4.12)
honeycomb-beeline (~> 2.11.0)
html_truncator (~> 0.4)
httparty (~> 0.20)
5 changes: 5 additions & 0 deletions app/assets/images/code-climate-svg.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 0 additions & 14 deletions app/assets/javascripts/base.js.erb
Original file line number Diff line number Diff line change
@@ -3,7 +3,6 @@
//= require lib/xss
//= require initializePage
//= require utilities/getImageForLink
//= require @honeybadger-io/js/dist/browser/honeybadger.js
//= require i18n
//= require ahoy.js/dist/ahoy.js

@@ -715,19 +714,6 @@ var instantClick
InstantClick.init();
}

// INITIALIZE/ERROR HANDLING

Honeybadger.configure({
apiKey: document.body.dataset.honeybadgerKey,
environment: "<%= Rails.env %>",
revision: document.body.dataset.releaseFootprint,
});

Honeybadger.beforeNotify(function(notice) {
const ignorePatterns = [/ResizeObserver/i, /MetaMask/i, /MtPopUpList/i, /ChunkLoadError/i]
return !(ignorePatterns.some((pattern) => pattern.test(notice.message)));
});

// INITIALIZE AHOY TRACKING
// Setting cookies to false matches what we do in ahoy's initializer.
// Setting trackVisits to false prevents ahoy from creating a visit on the server-side.
4 changes: 0 additions & 4 deletions app/assets/javascripts/utilities/getCsrfToken.js
Original file line number Diff line number Diff line change
@@ -19,10 +19,6 @@ function getCsrfToken() {

if (i === MAX_RETRIES) {
clearInterval(waitingOnCSRF);
Honeybadger.notify(
'Could not locate CSRF metatag ' +
JSON.stringify(localStorage.current_user),
);
return reject(new Error('Could not locate CSRF meta tag on the page.'));
}
}, RETRY_INTERVAL);
10 changes: 0 additions & 10 deletions app/controllers/omniauth_callbacks_controller.rb
Original file line number Diff line number Diff line change
@@ -73,23 +73,13 @@ def callback_for(provider)

user_errors = @user.errors.full_messages

Honeybadger.context({
username: @user.username,
user_id: @user.id,
auth_data: request.env["omniauth.auth"],
auth_error: request.env["omniauth.error"].inspect,
user_errors: user_errors
})
Honeybadger.notify("Omniauth log in error")

flash[:alert] = user_errors
redirect_to new_user_registration_url
end
rescue ::Authentication::Errors::PreviouslySuspended, ::Authentication::Errors::SpammyEmailDomain => e
flash[:global_notice] = e.message
redirect_to root_path
rescue StandardError => e
Honeybadger.notify(e)

flash[:alert] = I18n.t("omniauth_callbacks_controller.log_in_error", e: e)
redirect_to new_user_registration_url
6 changes: 1 addition & 5 deletions app/controllers/video_states_controller.rb
Original file line number Diff line number Diff line change
@@ -8,11 +8,7 @@ def create
render json: { message: "invalid_key" }, status: :unprocessable_entity
return
end
begin
request_json = JSON.parse(request.raw_post, symbolize_names: true)
rescue StandardError => e
Honeybadger.notify(e)
end
request_json = JSON.parse(request.raw_post, symbolize_names: true)
message_json = JSON.parse(request_json[:Message], symbolize_names: true)
@article = Article.find_by(video_code: message_json[:input][:key])

1 change: 0 additions & 1 deletion app/javascript/article-form/components/ImageUploader.jsx
Original file line number Diff line number Diff line change
@@ -205,7 +205,6 @@ const V1EditorImageUpload = ({
message: error,
addCloseButton: true,
});
Honeybadger.notify(error);
});
};
return (
1 change: 0 additions & 1 deletion app/javascript/githubRepos/__tests__/githubRepos.test.jsx
Original file line number Diff line number Diff line change
@@ -245,6 +245,5 @@ describe('<GithubRepos />', () => {
const errorAlert = await findByRole('alert');

expect(errorAlert.textContent).toEqual('An error occurred: some error');
expect(Honeybadger.notify).toHaveBeenCalledTimes(1);
});
});
1 change: 0 additions & 1 deletion app/javascript/githubRepos/githubRepos.jsx
Original file line number Diff line number Diff line change
@@ -22,7 +22,6 @@ export const GithubRepos = () => {
throw new Error(response.statusText);
}
} catch (error) {
Honeybadger.notify(error);
setError(true);
setErrorMessage(error.toString());
}
14 changes: 4 additions & 10 deletions app/javascript/mobile/foremMobile.js
Original file line number Diff line number Diff line change
@@ -37,8 +37,6 @@ export function foremMobileNamespace() {
}
})
.catch((error) => {
Honeybadger.notify(error);

// Increase backoff delay time
if (window.ForemMobile.retryDelayMs < 20000) {
window.ForemMobile.retryDelayMs =
@@ -63,14 +61,10 @@ export function foremMobileNamespace() {
document.dispatchEvent(event);
},
injectNativeMessage(namespace, message) {
try {
if (isNativeIOS(namespace)) {
window.webkit.messageHandlers[namespace].postMessage(message);
} else if (isNativeAndroid(`${namespace}Message`)) {
AndroidBridge[`${namespace}Message`](JSON.stringify(message));
}
} catch (error) {
Honeybadger.notify(error);
if (isNativeIOS(namespace)) {
window.webkit.messageHandlers[namespace].postMessage(message);
} else if (isNativeAndroid(`${namespace}Message`)) {
AndroidBridge[`${namespace}Message`](JSON.stringify(message));
}
},
userSessionBroadcast() {
1 change: 0 additions & 1 deletion app/javascript/onboarding/components/ProfileForm.jsx
Original file line number Diff line number Diff line change
@@ -63,7 +63,6 @@ export class ProfileForm extends Component {
const { next } = this.props;
next();
} catch (error) {
Honeybadger.notify(error.statusText);
let errorMessage = 'Unable to continue, please try again.';
if (error.status === 422) {
// parse validation error messages from UsersController#onboarding
21 changes: 6 additions & 15 deletions app/javascript/packs/base.jsx
Original file line number Diff line number Diff line change
@@ -99,26 +99,17 @@ waitOnBaseData()
});
}
})
.catch((error) => {
Honeybadger.notify(error);
});

initializeNav();

async function loadCreatorSettings() {
try {
const [{ LogoUploadController }, { Application }] = await Promise.all([
import('@admin/controllers/logo_upload_controller'),
import('@hotwired/stimulus'),
]);
const [{ LogoUploadController }, { Application }] = await Promise.all([
import('@admin/controllers/logo_upload_controller'),
import('@hotwired/stimulus'),
]);

const application = Application.start();
application.register('logo-upload', LogoUploadController);
} catch (error) {
Honeybadger.notify(
`Error loading the creator settings controller: ${error.message}`,
);
}
const application = Application.start();
application.register('logo-upload', LogoUploadController);
}

if (document.location.pathname === '/admin/creator_settings/new') {
3 changes: 0 additions & 3 deletions app/javascript/packs/runtimeBanner.jsx
Original file line number Diff line number Diff line change
@@ -21,7 +21,4 @@ waitOnBaseData()
});

loadElement();
})
.catch((error) => {
Honeybadger.notify(error);
});
4 changes: 0 additions & 4 deletions app/javascript/profileDropdown/flagButton.js
Original file line number Diff line number Diff line change
@@ -35,10 +35,6 @@ function addFlagUserBehavior(flagButton) {
}
})
.catch((e) => {
Honeybadger.notify(
isUserFlagged ? 'Unable to unflag user' : 'Unable to flag user',
profileUserId,
);
window.alert(`Something went wrong: ${e}`);
});
}
1 change: 0 additions & 1 deletion app/javascript/sidebar-widget/SidebarWidget.jsx
Original file line number Diff line number Diff line change
@@ -25,7 +25,6 @@ export const SidebarWidget = () => {
})
.catch((error) => {
setSuggestedUsers([]);
Honeybadger.notify(error);
});
}, []);

5 changes: 0 additions & 5 deletions app/javascript/utilities/http/csrfToken.js
Original file line number Diff line number Diff line change
@@ -17,11 +17,6 @@ export function getCSRFToken() {

if (i === MAX_RETRIES) {
clearInterval(waitingOnCSRF);
Honeybadger.notify(
`Could not locate CSRF metatag ${JSON.stringify(
localStorage.current_user,
)}`,
);
return reject(new Error('Could not locate CSRF meta tag on the page.'));
}
}, RETRY_INTERVAL);
3 changes: 0 additions & 3 deletions app/javascript/utilities/sendFollowUser.js
Original file line number Diff line number Diff line change
@@ -18,8 +18,5 @@ export function sendFollowUser(user, successCb) {
.then((json) => {
successCb(json.outcome);
// json is followed or unfollowed
})
.catch((error) => {
Honeybadger.notify(error);
});
}
2 changes: 0 additions & 2 deletions app/lib/release_phase_notifier.rb
Original file line number Diff line number Diff line change
@@ -9,7 +9,5 @@ def self.ping_slack
)

client.ping("Release Phase Failed: #{ENV.fetch('FAILED_COMMAND', nil)}")
rescue Slack::Notifier::APIError => e
Honeybadger.notify(e)
end
end
2 changes: 0 additions & 2 deletions app/services/broadcasts/welcome_notification/generator.rb
Original file line number Diff line number Diff line change
@@ -15,8 +15,6 @@ def call

notification_methods.each do |method|
send method unless notification_enqueued # rubocop:disable Style/Send
rescue ActiveRecord::RecordNotFound => e
Honeybadger.notify(e)
end
end

2 changes: 0 additions & 2 deletions app/services/edge_cache/bust.rb
Original file line number Diff line number Diff line change
@@ -15,7 +15,6 @@ def call(paths)
paths.each do |path|
@provider_class.call(path)
rescue StandardError => e
Honeybadger.notify(e)
ForemStatsClient.increment(
"edgecache_bust.provider_error",
tags: ["provider_class:#{@provider_class}", "error_class:#{e.class}"],
@@ -48,7 +47,6 @@ def nginx_enabled_and_available?
# If we can't connect to OpenResty, alert ourselves that it is
# unavailable and return false.
Rails.logger.error("Could not connect to OpenResty via #{ApplicationConfig['OPENRESTY_URL']}!")
Honeybadger.notify(e)
ForemStatsClient.increment("edgecache_bust.service_unavailable",
tags: ["path:#{ApplicationConfig['OPENRESTY_URL']}"])
end
1 change: 0 additions & 1 deletion app/services/payments/customer.rb
Original file line number Diff line number Diff line change
@@ -71,7 +71,6 @@ def request
ForemStatsClient.increment("stripe.errors", tags: ["error:CardError"])
raise CardError, e.message
rescue Stripe::StripeError => e
Honeybadger.notify(e)
ForemStatsClient.increment("stripe.errors", tags: ["error:StripeError"])
raise PaymentsError, e.message
end
6 changes: 5 additions & 1 deletion app/views/layouts/_logo.html.erb
Original file line number Diff line number Diff line change
@@ -3,7 +3,11 @@
<img class="site-logo__img" src="<%= Settings::General.resized_logo %>" alt="<%= community_name %>">
<% else %>
<span class="site-logo__community-name truncate-at-2">
<%= community_name %>
<svg width="24px" height="24px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd"
d="M17.8328 7.55084L15.0044 4.72241L12.1759 7.55084L11.471 8.2558L14.2994 11.0842L15.0044 10.3793L20.6612 16.0361L23.4897 13.2077L17.8328 7.55084ZM8.99504 7.96375L11.8235 10.7922L17.4803 16.449L14.6519 19.2775L8.99504 13.6206L3.33818 19.2775L0.509766 16.449L6.16661 10.7922L8.99504 7.96375Z"
fill="black"/>
</svg><%= community_name %>
</span>
<% end %>
</a>
3 changes: 0 additions & 3 deletions app/views/layouts/_user_config.html.erb
Original file line number Diff line number Diff line change
@@ -35,8 +35,5 @@
}
}
} catch (e) {
setTimeout(function () {
Honeybadger.notify(e);
}, 1000)
}
</script>
2 changes: 0 additions & 2 deletions app/views/notifications/_notifications_list.html.erb
Original file line number Diff line number Diff line change
@@ -7,8 +7,6 @@

<% rescue => e %>

<% Honeybadger.notify(e, context: { notification_id: notification.id }) %>

<div class="align-center p-9 py-10 color-base-80 crayons-card mb-2">
<h2 class="fw-bold fs-l"><%= t("views.notifications.error.subtitle") %></h2>
<p class="color-base-60 pt-2"><%= t("views.notifications.error.desc") %></p>
3 changes: 0 additions & 3 deletions app/views/notifications/index.html.erb
Original file line number Diff line number Diff line change
@@ -33,9 +33,6 @@

// TODO: [@forem/delightful]: This event doesn't appear to be firing on Honeybadger.
// We probably want to remove it eventually if we continually don't see it being triggered.
if (!title) {
Honeybadger.notify(`Could not find parentElement.id when clicking on event target text: ${text}`);
}

ahoy.track("Clicked Welcome Notification", { title, text, target: target.toString() });
}
18 changes: 1 addition & 17 deletions app/views/pages/robots.text.erb
Original file line number Diff line number Diff line change
@@ -1,18 +1,2 @@
User-agent: *
Disallow: /*/actions_panel*
Disallow: /users/auth/twitter*
Disallow: /users/auth/github*
Disallow: /report-abuse?url=*
Disallow: /connect/@*
Disallow: /search?q=*
Disallow: /search/?q=*
Disallow: /search/feed_content?*
Disallow: /listings*?q=*
Disallow: /mod/*
Disallow: /mod?*
Disallow: /admin/*
Disallow: /reactions?*
Disallow: /async_info/base_data
Disallow: /ahoy/*

Sitemap: <%= URL.url("sitemap-index.xml") %>
Disallow: /
2 changes: 0 additions & 2 deletions app/workers/data_update_worker.rb
Original file line number Diff line number Diff line change
@@ -29,8 +29,6 @@ def run_script(script)
rescue StandardError => e
script.mark_as_failed!(e)
log_status(script)

Honeybadger.notify(e, context: { script_id: script.id })
end

def log_status(script)
7 changes: 1 addition & 6 deletions app/workers/emails/send_user_digest_worker.rb
Original file line number Diff line number Diff line change
@@ -11,12 +11,7 @@ def perform(user_id)
articles = EmailDigestArticleCollector.new(user).articles_to_send
return unless articles.any?

begin
DigestMailer.with(user: user, articles: articles.to_a).digest_email.deliver_now
rescue StandardError => e
Honeybadger.context({ user_id: user.id, article_ids: articles.map(&:id) })
Honeybadger.notify(e)
end
DigestMailer.with(user: user, articles: articles.to_a).digest_email.deliver_now
end
end
end
1 change: 0 additions & 1 deletion app/workers/moderator/banish_user_worker.rb
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@ def perform(admin_id, abuser_id)
Moderator::BanishUser.call(admin: admin, user: abuser)
rescue StandardError => e
ForemStatsClient.count("moderators.banishuser", 1, tags: ["action:failed", "user_id:#{abuser.id}"])
Honeybadger.notify(e)
end
end
end
1 change: 0 additions & 1 deletion app/workers/moderator/sink_articles_worker.rb
Original file line number Diff line number Diff line change
@@ -11,7 +11,6 @@ def perform(user_id)
Article.published.where(user: user).each(&:update_score)
rescue StandardError => e
ForemStatsClient.count("moderators.sink", 1, tags: ["action:failed", "user_id:#{user.id}"])
Honeybadger.notify(e)
end
end
end
2 changes: 0 additions & 2 deletions app/workers/organizations/delete_worker.rb
Original file line number Diff line number Diff line change
@@ -24,8 +24,6 @@ def perform(organization_id, operator_id)
rescue StandardError => e
ForemStatsClient.count("organizations.delete", 1,
tags: ["action:failed", "organization_id:#{org.id}", "user_id:#{user.id}"])
Honeybadger.context({ organization_id: org.id, user_id: user.id })
Honeybadger.notify(e)
end

def audit_log(org, user)
2 changes: 0 additions & 2 deletions app/workers/users/delete_worker.rb
Original file line number Diff line number Diff line change
@@ -20,8 +20,6 @@ def perform(user_id, admin_delete = false) # rubocop:disable Style/OptionalBoole
NotifyMailer.with(name: user.name, email: user.email).account_deleted_email.deliver_now
rescue StandardError => e
ForemStatsClient.count("users.delete", 1, tags: ["action:failed", "user_id:#{user.id}"])
Honeybadger.context({ user_id: user.id })
Honeybadger.notify(e)
end
end
end
9 changes: 9 additions & 0 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
@@ -6,6 +6,15 @@
# If we have not set this ENV var it means we haven't set the environment
ENV["ENV_AVAILABLE"] = ENV["APP_DOMAIN"].present?.to_s

# config/environments/production.rb
config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present?

if ENV["RAILS_LOG_TO_STDOUT"].present?
logger = ActiveSupport::Logger.new($stdout)
logger.formatter = config.log_formatter
config.logger = ActiveSupport::TaggedLogging.new(logger)
end

if ENV["ENV_AVAILABLE"] == "false"
# We still need _something_ here, but if booted without environment (aka asset precompile),
# it shouldn't need to be the proper value
55 changes: 0 additions & 55 deletions config/initializers/honeybadger.rb

This file was deleted.

3 changes: 0 additions & 3 deletions config/initializers/rpush.rb
Original file line number Diff line number Diff line change
@@ -73,9 +73,6 @@
Device.ios.where(token: notification.device_token).destroy_all
end

Honeybadger.notify(error_message:
"error_description: #{notification.error_description}, error_code: #{notification.error_code}")

ForemStatsClient.increment(
"push_notifications.errors",
tags: [
2 changes: 1 addition & 1 deletion db/seeds.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# rubocop:disable Rails/Output

return if Rails.env.production?
# return if Rails.env.production?

# NOTE: when adding new data, please use the Seeder class to ensure the seed tasks
# stays idempotent.
11 changes: 9 additions & 2 deletions lib/tasks/app_initializer.rake
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
namespace :app_initializer do
desc "Prepare Application on Boot Up"
task setup: :environment do
puts "\n== Checking for hypershield =="
if ActiveRecord::Base.connection.schema_exists?("hypershield")
puts "\n== Hypershield found, Red alert, all hands to battle stations =="
else
puts "\n== Hypershield not found, init... =="
ActiveRecord::Base.connection.execute("CREATE SCHEMA hypershield")
end

puts "\n== Preparing database =="
system("bin/rails db:prepare") || exit!(1)
Rake::Task["db:migrate"].execute # it'll re-alphabetize the columns in `schema.rb`
@@ -19,8 +27,7 @@ namespace :app_initializer do
end
end

if ENV["ENABLE_HYPERSHIELD"].present?
# enhance must be passed a block here to ensure that our hypershield task
if ENV["ENABLE_HYPERSHIELD"].present? # enhance must be passed a block here to ensure that our hypershield task
# runs AFTER db:prepare. Passing it as an argument will cause it to run BEFORE
# https://ruby-doc.org/stdlib-2.0.0/libdoc/rake/rdoc/Rake/Task.html#method-i-enhance
Rake::Task["db:prepare"].enhance do
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -103,7 +103,7 @@
"@babel/preset-env": "^7.19.4",
"@etchteam/storybook-addon-css-variables-theme": "^1.3.3",
"@github/time-elements": "3.1.2",
"@honeybadger-io/js": "^4.6.0",
"@honeybadger-io/js": "^4.6.2",
"@honeybadger-io/webpack": "^1.5.1",
"@hotwired/stimulus": "3.1.0",
"@hotwired/stimulus-webpack-helpers": "1.0.1",
2 changes: 1 addition & 1 deletion release-tasks.sh
Original file line number Diff line number Diff line change
@@ -16,5 +16,5 @@ set -Eex

# runs migration for Postgres and boots the app to check there are no errors
STATEMENT_TIMEOUT=4500000 bundle exec rails app_initializer:setup
bundle exec rake fastly:update_configs
#bundle exec rake fastly:update_configs
bundle exec rails runner "puts 'app load success'"
Binary file removed vendor/cache/honeybadger-4.12.2.gem
Binary file not shown.
63 changes: 58 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
@@ -1924,13 +1924,14 @@
dependencies:
stacktrace-parser "^0.1.10"

"@honeybadger-io/js@^4.6.0":
version "4.6.0"
resolved "https://registry.yarnpkg.com/@honeybadger-io/js/-/js-4.6.0.tgz#ca192ca3222a6bb9f9046bb5f5fb0af6f272f889"
integrity sha512-7eV99zBQRi8ZrbFDj97LdGWqbIU8vyNXFZsxSYefwye1tHnZSDqvAoZqukutrK34J5t5KzLNbZysYXofEP+Jbg==
"@honeybadger-io/js@^4.6.2":
version "4.6.2"
resolved "https://registry.yarnpkg.com/@honeybadger-io/js/-/js-4.6.2.tgz#9de526d6e6ea68ddbf53200b5cbe4de0bdfbf8b5"
integrity sha512-O1IxQ2F0AOE1IqlN1MJ2zmrcAT9TiLnEMX8bEFgRMrIyZF9DWWuE9bAFMBhbmDbEMHDQJpYlcn3NH0i87dOJgQ==
dependencies:
"@honeybadger-io/core" "^4.6.0"
"@types/aws-lambda" "^8.10.89"
"@types/express" "^4.17.13"

"@honeybadger-io/webpack@^1.5.1":
version "1.5.1"
@@ -3560,6 +3561,21 @@
dependencies:
"@babel/types" "^7.3.0"

"@types/body-parser@*":
version "1.19.2"
resolved "https://registry.yarnpkg.com/@types/body-parser/-/body-parser-1.19.2.tgz#aea2059e28b7658639081347ac4fab3de166e6f0"
integrity sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==
dependencies:
"@types/connect" "*"
"@types/node" "*"

"@types/connect@*":
version "3.4.35"
resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.35.tgz#5fcf6ae445e4021d1fc2219a4873cc73a3bb2ad1"
integrity sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==
dependencies:
"@types/node" "*"

"@types/eslint-scope@^3.7.3":
version "3.7.3"
resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.3.tgz#125b88504b61e3c8bc6f870882003253005c3224"
@@ -3586,6 +3602,25 @@
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.51.tgz#cfd70924a25a3fd32b218e5e420e6897e1ac4f40"
integrity sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ==

"@types/express-serve-static-core@^4.17.18":
version "4.17.31"
resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.31.tgz#a1139efeab4e7323834bb0226e62ac019f474b2f"
integrity sha512-DxMhY+NAsTwMMFHBTtJFNp5qiHKJ7TeqOo23zVEM9alT1Ml27Q3xcTH0xwxn7Q0BbMcVEJOs/7aQtUWupUQN3Q==
dependencies:
"@types/node" "*"
"@types/qs" "*"
"@types/range-parser" "*"

"@types/express@^4.17.13":
version "4.17.14"
resolved "https://registry.yarnpkg.com/@types/express/-/express-4.17.14.tgz#143ea0557249bc1b3b54f15db4c81c3d4eb3569c"
integrity sha512-TEbt+vaPFQ+xpxFLFssxUDXj5cWCxZJjIcB7Yg0k0GMHGtgtQgpvx/MUQUeAkNbA9AAGrwkAsoeItdTgS7FMyg==
dependencies:
"@types/body-parser" "*"
"@types/express-serve-static-core" "^4.17.18"
"@types/qs" "*"
"@types/serve-static" "*"

"@types/glob@*":
version "7.2.0"
resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.2.0.tgz#bc1b5bf3aa92f25bd5dd39f35c57361bdce5b2eb"
@@ -3689,6 +3724,11 @@
dependencies:
"@types/unist" "*"

"@types/mime@*":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@types/mime/-/mime-3.0.1.tgz#5f8f2bca0a5863cb69bc0b0acd88c96cb1d4ae10"
integrity sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA==

"@types/minimatch@*":
version "3.0.5"
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.5.tgz#1001cc5e6a3704b83c236027e77f2f58ea010f40"
@@ -3752,11 +3792,24 @@
resolved "https://registry.yarnpkg.com/@types/q/-/q-1.5.5.tgz#75a2a8e7d8ab4b230414505d92335d1dcb53a6df"
integrity sha512-L28j2FcJfSZOnL1WBjDYp2vUHCeIFlyYI/53EwD/rKUBQ7MtUUfbQWiyKJGpcnv4/WgrhWsFKrcPstcAt/J0tQ==

"@types/qs@^6.9.5":
"@types/qs@*", "@types/qs@^6.9.5":
version "6.9.7"
resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.7.tgz#63bb7d067db107cc1e457c303bc25d511febf6cb"
integrity sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==

"@types/range-parser@*":
version "1.2.4"
resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.4.tgz#cd667bcfdd025213aafb7ca5915a932590acdcdc"
integrity sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==

"@types/serve-static@*":
version "1.15.0"
resolved "https://registry.yarnpkg.com/@types/serve-static/-/serve-static-1.15.0.tgz#c7930ff61afb334e121a9da780aac0d9b8f34155"
integrity sha512-z5xyF6uh8CbjAu9760KDKsH2FcDxZ2tFCsA4HIMWE6IkiYMXfVoa+4f9KX+FN0ZLsaMw1WNG2ETLA6N+/YA+cg==
dependencies:
"@types/mime" "*"
"@types/node" "*"

"@types/sinonjs__fake-timers@8.1.1":
version "8.1.1"
resolved "https://registry.yarnpkg.com/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.1.tgz#b49c2c70150141a15e0fa7e79cf1f92a72934ce3"