From ff955672ebbdc81ea41e29850d18cac03b6817b7 Mon Sep 17 00:00:00 2001 From: Charlie Cheesman Date: Mon, 13 May 2024 22:34:23 +0100 Subject: [PATCH 01/94] minor update to re-push --- .slugignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.slugignore b/.slugignore index ef9d84b4..3ee05081 100644 --- a/.slugignore +++ b/.slugignore @@ -34,6 +34,9 @@ spec/** .gitignore .dockerignore +# Ignore contributing files +CONTRIBUTING.md + # Ignore yml files generated by VCR. spec/fixtures/cassettes/ApplicantTrackingSystem/*.yml From f1fcdf828b3ab4d1d7135a449cb5de7e988f880f Mon Sep 17 00:00:00 2001 From: Charlie Cheesman Date: Mon, 13 May 2024 22:56:11 +0100 Subject: [PATCH 02/94] change matching for log and tmp files --- .slugignore | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.slugignore b/.slugignore index 3ee05081..8a700ce9 100644 --- a/.slugignore +++ b/.slugignore @@ -8,8 +8,8 @@ !/.env*.erb # Ignore all logfiles and tempfiles. -/log/* -/tmp/* +log/** +tmp/** !/log/.keep !/tmp/.keep From 45b4d5aff6f483026e64b86d25cac3e523c67c4a Mon Sep 17 00:00:00 2001 From: Charlie Cheesman Date: Tue, 14 May 2024 07:32:49 +0100 Subject: [PATCH 03/94] change log file matching --- .slugignore | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.slugignore b/.slugignore index 8a700ce9..3ee05081 100644 --- a/.slugignore +++ b/.slugignore @@ -8,8 +8,8 @@ !/.env*.erb # Ignore all logfiles and tempfiles. -log/** -tmp/** +/log/* +/tmp/* !/log/.keep !/tmp/.keep From d3c9e4835540a98cb04dacf8feab2add6c911576 Mon Sep 17 00:00:00 2001 From: Charlie Cheesman Date: Fri, 17 May 2024 16:40:06 +0100 Subject: [PATCH 04/94] refactor job card into separate partials --- app/views/jobs/_add_job_to_basket.html.erb | 24 +++++ app/views/jobs/_basic_info.html.erb | 13 +++ app/views/jobs/_climate_rating.html.erb | 3 + app/views/jobs/_difficulty_rating.html.erb | 13 +++ app/views/jobs/_job_card.html.erb | 101 ++------------------- app/views/jobs/_job_info.html.erb | 22 +++++ app/views/jobs/_logo.html.erb | 5 + 7 files changed, 87 insertions(+), 94 deletions(-) create mode 100644 app/views/jobs/_add_job_to_basket.html.erb create mode 100644 app/views/jobs/_basic_info.html.erb create mode 100644 app/views/jobs/_climate_rating.html.erb create mode 100644 app/views/jobs/_difficulty_rating.html.erb create mode 100644 app/views/jobs/_job_info.html.erb create mode 100644 app/views/jobs/_logo.html.erb diff --git a/app/views/jobs/_add_job_to_basket.html.erb b/app/views/jobs/_add_job_to_basket.html.erb new file mode 100644 index 00000000..7e8d33a3 --- /dev/null +++ b/app/views/jobs/_add_job_to_basket.html.erb @@ -0,0 +1,24 @@ +
+ <% if user_signed_in? %> + <% if @saved_job_ids.include?(job.id) %> + <%= link_to saved_job_path(job.saved_job_ids), data: {turbo_method: :delete} do %> + + <% end %> + <% else %> + <%= link_to job_saved_jobs_path(job), data: {turbo_method: :post} do %> + + <% end %> + <% end %> + <% include_checkboxes ||= false %> + <% if include_checkboxes %> +
+ <%= check_box_tag "job_ids[]", job.id, onclick: "document.getElementById('apply_button').disabled = false" %> +
+ <% end %> + <% end %> + + <%= link_to job.posting_url, target: "_blank" do %> + + <% end %> +
+ diff --git a/app/views/jobs/_basic_info.html.erb b/app/views/jobs/_basic_info.html.erb new file mode 100644 index 00000000..264e8161 --- /dev/null +++ b/app/views/jobs/_basic_info.html.erb @@ -0,0 +1,13 @@ +
+
<%= job.salary.present? ? job.salary : "
".html_safe %>
+
<%= job.employment_type %> • + <% if job.remote %> + <%= "Remote"%> + <% elsif job.hybrid %> + <%= "Hybrid" %> + <% else %> + <%= "In-office" %> + <% end %> +
+
<%= job.date_posted.strftime("%d/%m") %>
<%= (job.deadline.nil? || job.deadline < Date.today) ? "Rolling" : job.deadline.strftime("%d/%m") %>
+
diff --git a/app/views/jobs/_climate_rating.html.erb b/app/views/jobs/_climate_rating.html.erb new file mode 100644 index 00000000..f23cfa1f --- /dev/null +++ b/app/views/jobs/_climate_rating.html.erb @@ -0,0 +1,3 @@ +
+
<%# job.company.carbon_pledge || 'no data' %>no data
+
diff --git a/app/views/jobs/_difficulty_rating.html.erb b/app/views/jobs/_difficulty_rating.html.erb new file mode 100644 index 00000000..e404e4f8 --- /dev/null +++ b/app/views/jobs/_difficulty_rating.html.erb @@ -0,0 +1,13 @@ +
+
+ <%# To-do: Create a difficulty column for jobs table and transfer this logic to JobCreator; eventually GetFormFieldsJob will distinguish between input and text fields (for longer responses), which will help with accurate classification %> + <% if job.requirement.no_of_qs < 8 && !job.requirement.cover_letter %> + <% apply_rating = 'no data' %> + <% elsif job.requirement.no_of_qs > 15 %> + <% apply_rating = 'hard' %> + <% else %> + <% apply_rating = 'medium' %> + <% end %> + <%= apply_rating %> +
+
diff --git a/app/views/jobs/_job_card.html.erb b/app/views/jobs/_job_card.html.erb index 2f64adf3..0b6dd6f9 100644 --- a/app/views/jobs/_job_card.html.erb +++ b/app/views/jobs/_job_card.html.erb @@ -1,103 +1,16 @@
- <%# TODO: Store company logo, use clearbit when we don't have one %> - - <%# Logo %> + <%# Logo & Info %>
-
- <%= link_to company_path(job.company), target: "_blank" do %> - <%= image_tag("https://logo.clearbit.com/#{job.company.url_website}", onerror: "this.src='https://i.pinimg.com/736x/ec/d9/c2/ecd9c2e8ed0dbbc96ac472a965e4afda.jpg'", style: "width: 60px; height: 60px; padding-right: 0.5rem;") %> - <% end %> -
- - <%# Job Title, Company, Location %> -
- <%= link_to job_path(job), target: "_blank" do %> - <%= job.title.truncate(35) %> - <% end %> - - <%= link_to company_path(job.company), target: "_blank" do %> - <%= job.company.name %> - <% end %> - -
- <% if job.remote || job.locations.empty? %> - Remote - <% else %> - <%= job.locations.map(&:city).join(' | ') %> - <% end %> - <% if job.countries.loaded? || job.countries.count == 1 %> - <%= " | #{job.countries.first.name}" if job.countries.count == 1 %> - <% else %> - <%= " | #{job.countries.first.name}" if job.countries.size == 1 %> - <% end %> -
-
+ <%= render partial: 'jobs/logo', locals: { job: job } %> + <%= render partial: 'jobs/job_info', locals: { job: job } %>
<%# Job Details %>
- - <%# Salary etc. %> -
-
<%= job.salary.present? ? job.salary : "
".html_safe %>
-
<%= job.employment_type %> • - <% if job.remote %> - <%= "Remote"%> - <% elsif job.hybrid %> - <%= "Hybrid" %> - <% else %> - <%= "In-office" %> - <% end %> -
-
<%= job.date_posted.strftime("%d/%m") %>
<%= (job.deadline.nil? || job.deadline < Date.today) ? "Rolling" : job.deadline.strftime("%d/%m") %>
-
- - <%# Net Zero Rating %> -
-
<%# job.company.carbon_pledge || 'no data' %>no data
-
- - <%# Ease of Applying %> -
-
- <%# To-do: Create a difficulty column for jobs table and transfer this logic to JobCreator; eventually GetFormFieldsJob will distinguish between input and text fields (for longer responses), which will help with accurate classification %> - <% if job.requirement.no_of_qs < 8 && !job.requirement.cover_letter %> - <% apply_rating = 'no data' %> - <% elsif job.requirement.no_of_qs > 15 %> - <% apply_rating = 'hard' %> - <% else %> - <% apply_rating = 'medium' %> - <% end %> - <%= apply_rating %> -
-
- - - <%# Add job to basket %> -
- <% if user_signed_in? %> - <% if @saved_job_ids.include?(job.id) %> - <%= link_to saved_job_path(job.saved_job_ids), data: {turbo_method: :delete} do %> - - <% end %> - <% else %> - <%= link_to job_saved_jobs_path(job), data: {turbo_method: :post} do %> - - <% end %> - <% end %> - <% include_checkboxes ||= false %> - <% if include_checkboxes %> -
- <%= check_box_tag "job_ids[]", job.id, onclick: "document.getElementById('apply_button').disabled = false" %> -
- <% end %> - <% end %> - - <%= link_to job.posting_url, target: "_blank" do %> - - <% end %> -
-
+ <%= render partial: 'jobs/basic_info', locals: { job: job } %> + <%= render partial: 'jobs/climate_rating', locals: { job: job } %> + <%= render partial: 'jobs/difficulty_rating', locals: { job: job } %> + <%= render partial: 'jobs/add_job_to_basket', locals: { job: job, saved_job_ids: @saved_job_ids } %>
diff --git a/app/views/jobs/_job_info.html.erb b/app/views/jobs/_job_info.html.erb new file mode 100644 index 00000000..86127fb0 --- /dev/null +++ b/app/views/jobs/_job_info.html.erb @@ -0,0 +1,22 @@ +
+ <%= link_to job_path(job), target: "_blank" do %> + <%= job.title.truncate(35) %> + <% end %> + + <%= link_to company_path(job.company), target: "_blank" do %> + <%= job.company.name %> + <% end %> + +
+ <% if job.remote || job.locations.empty? %> + Remote + <% else %> + <%= job.locations.map(&:city).join(' | ') %> + <% end %> + <% if job.countries.loaded? || job.countries.count == 1 %> + <%= " | #{job.countries.first.name}" if job.countries.count == 1 %> + <% else %> + <%= " | #{job.countries.first.name}" if job.countries.size == 1 %> + <% end %> +
+
diff --git a/app/views/jobs/_logo.html.erb b/app/views/jobs/_logo.html.erb new file mode 100644 index 00000000..cbe9aec4 --- /dev/null +++ b/app/views/jobs/_logo.html.erb @@ -0,0 +1,5 @@ +
+ <%= link_to company_path(job.company), target: "_blank" do %> + <%= image_tag("https://logo.clearbit.com/#{job.company.url_website}", onerror: "this.src='https://i.pinimg.com/736x/ec/d9/c2/ecd9c2e8ed0dbbc96ac472a965e4afda.jpg'", style: "width: 60px; height: 60px; padding-right: 0.5rem;") %> + <% end %> +
From 35b627146593c060a6fc7bbae9ebbfb20d3ea7b1 Mon Sep 17 00:00:00 2001 From: Charlie Cheesman Date: Fri, 17 May 2024 16:40:53 +0100 Subject: [PATCH 05/94] correct incorrectly placed div --- app/views/jobs/_add_job_to_basket.html.erb | 1 - app/views/jobs/_job_card.html.erb | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/jobs/_add_job_to_basket.html.erb b/app/views/jobs/_add_job_to_basket.html.erb index 7e8d33a3..4ac2b1ee 100644 --- a/app/views/jobs/_add_job_to_basket.html.erb +++ b/app/views/jobs/_add_job_to_basket.html.erb @@ -21,4 +21,3 @@ <% end %> - diff --git a/app/views/jobs/_job_card.html.erb b/app/views/jobs/_job_card.html.erb index 0b6dd6f9..0d119c1b 100644 --- a/app/views/jobs/_job_card.html.erb +++ b/app/views/jobs/_job_card.html.erb @@ -12,5 +12,6 @@ <%= render partial: 'jobs/climate_rating', locals: { job: job } %> <%= render partial: 'jobs/difficulty_rating', locals: { job: job } %> <%= render partial: 'jobs/add_job_to_basket', locals: { job: job, saved_job_ids: @saved_job_ids } %> + From 1409c342aec3b7bf86571640b7d8d7adcbe603ac Mon Sep 17 00:00:00 2001 From: Charlie Cheesman Date: Fri, 17 May 2024 16:53:59 +0100 Subject: [PATCH 06/94] update meta tags --- app/views/jobs/index.html.erb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/views/jobs/index.html.erb b/app/views/jobs/index.html.erb index 407cf02b..15be94c0 100644 --- a/app/views/jobs/index.html.erb +++ b/app/views/jobs/index.html.erb @@ -1,14 +1,12 @@ -<%# The title meta tag here seems to be affecting the filter_category_sidebar. Not sure how to fix because I don't want to break anything but uncomment the title "All Jobs" below to see what I mean %> - -<%# <% title "All Jobs" %> -<% description "Discover thousands of jobs on our platform. With Cheddar's innovative one-click applciation process, you can select multiple positions that interest you and apply to all of them at once without having to leave our site." %> +<% title "Find Jobs" %> +<% description "Discover and apply to thousands of jobs with Cheddar's innovative one-click application process. Add jobs that interest you to your basket and apply to all of them at once, without ever need to leave our site." %>
<%= render 'search' %>
- +
<%= render 'category_sidebar' %> <%= render 'job_cards_container' %> From 535439defab940de8ad0ca20b7a5165b864f6b62 Mon Sep 17 00:00:00 2001 From: Charlie Cheesman Date: Fri, 17 May 2024 16:54:04 +0100 Subject: [PATCH 07/94] start to add responsiveness --- app/views/jobs/_job_card.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/jobs/_job_card.html.erb b/app/views/jobs/_job_card.html.erb index 0d119c1b..bdafd5a3 100644 --- a/app/views/jobs/_job_card.html.erb +++ b/app/views/jobs/_job_card.html.erb @@ -1,13 +1,13 @@
<%# Logo & Info %> -
+
<%= render partial: 'jobs/logo', locals: { job: job } %> <%= render partial: 'jobs/job_info', locals: { job: job } %>
<%# Job Details %> -
+
<%= render partial: 'jobs/basic_info', locals: { job: job } %> <%= render partial: 'jobs/climate_rating', locals: { job: job } %> <%= render partial: 'jobs/difficulty_rating', locals: { job: job } %> From 4f1192029f2f933615eaa4a9c4d8afe34dfc054f Mon Sep 17 00:00:00 2001 From: Charlie Cheesman Date: Fri, 17 May 2024 17:03:51 +0100 Subject: [PATCH 08/94] adding responsiveness to the index page --- app/views/jobs/_category_sidebar.html.erb | 3 +-- app/views/jobs/_job_cards_container.html.erb | 2 +- app/views/jobs/index.html.erb | 14 ++++++++++---- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/app/views/jobs/_category_sidebar.html.erb b/app/views/jobs/_category_sidebar.html.erb index 0794c6e1..ba480f32 100644 --- a/app/views/jobs/_category_sidebar.html.erb +++ b/app/views/jobs/_category_sidebar.html.erb @@ -1,4 +1,4 @@ -
+

<%= @jobs.count %> jobs • <%= link_to 'Clear filters', jobs_path %>

@@ -20,5 +20,4 @@ <% @resources.each_with_index do |(resource, data), index| %> <%= render partial: 'category_sidebar_section', locals: {title: section_titles[index], resource: resource, resources: data, icon: icons[index]} %> <% end %> -
diff --git a/app/views/jobs/_job_cards_container.html.erb b/app/views/jobs/_job_cards_container.html.erb index ab9871d8..50b792a2 100644 --- a/app/views/jobs/_job_cards_container.html.erb +++ b/app/views/jobs/_job_cards_container.html.erb @@ -1,4 +1,4 @@ -
+
<%= render partial: 'job_card', collection: @jobs, as: :job %> diff --git a/app/views/jobs/index.html.erb b/app/views/jobs/index.html.erb index 15be94c0..c092ac82 100644 --- a/app/views/jobs/index.html.erb +++ b/app/views/jobs/index.html.erb @@ -3,12 +3,18 @@
-
- <%= render 'search' %> +
+
+ <%= render 'search' %> +
- <%= render 'category_sidebar' %> - <%= render 'job_cards_container' %> +
+ <%= render 'job_cards_container' %> +
+
+ <%= render 'category_sidebar' %> +
From 4cc794ffa703344d96885f0fbcbc05f3cd3b88b3 Mon Sep 17 00:00:00 2001 From: Charlie Cheesman Date: Fri, 17 May 2024 20:47:51 +0100 Subject: [PATCH 09/94] install brakeman to review vulnerabilities --- Gemfile | 2 +- Gemfile.lock | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index d45eb469..7949fdfd 100644 --- a/Gemfile +++ b/Gemfile @@ -136,7 +136,7 @@ group :development do gem "binding_of_caller" # Security - # gem 'brakeman', require: false # TODO: install this gem for security checks + gem 'brakeman', require: false # Performance # Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler] diff --git a/Gemfile.lock b/Gemfile.lock index 813f7628..77e3995b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -114,6 +114,8 @@ GEM bootstrap (5.3.2) autoprefixer-rails (>= 9.1.0) popper_js (>= 2.11.8, < 3) + brakeman (6.1.2) + racc builder (3.2.4) bullet (7.1.6) activesupport (>= 3.0.0) @@ -484,6 +486,7 @@ DEPENDENCIES binding_of_caller bootsnap bootstrap + brakeman bullet capybara cloudinary From ea578117efb55af865d063fb71242bdbaefde70a Mon Sep 17 00:00:00 2001 From: Charlie Cheesman Date: Fri, 17 May 2024 21:12:29 +0100 Subject: [PATCH 10/94] add new relic --- Gemfile | 2 +- Gemfile.lock | 2 ++ config/newrelic.yml | 66 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 config/newrelic.yml diff --git a/Gemfile b/Gemfile index 7949fdfd..3b4697ab 100644 --- a/Gemfile +++ b/Gemfile @@ -88,7 +88,7 @@ gem 'rails-html-sanitizer' gem "flipper-active_record", "~> 1.3" # Monitoring -# gem 'newrelic_rpm' # TODO: install this gem for monitoring +gem 'newrelic_rpm' # Analytics # gem 'analytics-ruby', '~> 2.4.0', :require => 'segment/analytics' # TODO: install this gem for analytics diff --git a/Gemfile.lock b/Gemfile.lock index 77e3995b..d4d25a32 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -248,6 +248,7 @@ GEM timeout net-smtp (0.5.0) net-protocol + newrelic_rpm (9.9.0) nio4r (2.7.1) nokogiri (1.16.4-aarch64-linux) racc (~> 1.4) @@ -505,6 +506,7 @@ DEPENDENCIES importmap-rails json (~> 2.6, >= 2.6.3) meta-tags + newrelic_rpm nokogiri pg (~> 1.1) pg_search diff --git a/config/newrelic.yml b/config/newrelic.yml new file mode 100644 index 00000000..cc703582 --- /dev/null +++ b/config/newrelic.yml @@ -0,0 +1,66 @@ +# +# This file configures the New Relic Agent. New Relic monitors Ruby, Java, +# .NET, PHP, Python, Node, and Go applications with deep visibility and low +# overhead. For more information, visit www.newrelic.com. +# +# Generated October 28, 2022 +# +# This configuration file is custom generated for NewRelic Administration +# +# For full documentation of agent configuration options, please refer to +# https://docs.newrelic.com/docs/agents/ruby-agent/installation-configuration/ruby-agent-configuration + +common: &default_settings + # Required license key associated with your New Relic account. + license_key: 'eu01xxe39d912918d76719c3e7f88b36FFFFNRAL' + + # Your application name. Renaming here affects where data displays in New + # Relic. For more details, see https://docs.newrelic.com/docs/apm/new-relic-apm/maintenance/renaming-applications + app_name: 'cheddar' + + distributed_tracing: + enabled: true + + # To disable the agent regardless of other settings, uncomment the following: + + # agent_enabled: false + + # Logging level for log/newrelic_agent.log + log_level: info + + application_logging: + # If `true`, all logging-related features for the agent can be enabled or disabled + # independently. If `false`, all logging-related features are disabled. + enabled: true + forwarding: + # If `true`, the agent captures log records emitted by this application. + enabled: true + # Defines the maximum number of log records to buffer in memory at a time. + max_samples_stored: 10000 + metrics: + # If `true`, the agent captures metrics related to logging for this application. + enabled: true + local_decorating: + # If `true`, the agent decorates logs with metadata to link to entities, hosts, traces, and spans. + # This requires a log forwarder to send your log files to New Relic. + # This should not be used when forwarding is enabled. + enabled: false + +# Environment-specific settings are in this section. +# RAILS_ENV or RACK_ENV (as appropriate) is used to determine the environment. +# If your application has other named environments, configure them here. +development: + <<: *default_settings + app_name: 'cheddar (Development)' + +test: + <<: *default_settings + # It doesn't make sense to report to New Relic from automated test runs. + monitor_mode: false + +staging: + <<: *default_settings + app_name: 'cheddar (Staging)' + +production: + <<: *default_settings From f15d3f3cee89098ff3a0126aff4a2f711220549e Mon Sep 17 00:00:00 2001 From: Charlie Cheesman Date: Sat, 18 May 2024 08:00:29 +0100 Subject: [PATCH 11/94] hide license key --- config/newrelic.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/newrelic.yml b/config/newrelic.yml index cc703582..dd41b117 100644 --- a/config/newrelic.yml +++ b/config/newrelic.yml @@ -12,7 +12,7 @@ common: &default_settings # Required license key associated with your New Relic account. - license_key: 'eu01xxe39d912918d76719c3e7f88b36FFFFNRAL' + license_key: ENV.fetch('NEW_RELIC_LICENSE_KEY') # Your application name. Renaming here affects where data displays in New # Relic. For more details, see https://docs.newrelic.com/docs/apm/new-relic-apm/maintenance/renaming-applications From 90f23ac8054f312b577c76f8d451ead5a4f7cf23 Mon Sep 17 00:00:00 2001 From: Charlie Cheesman Date: Sat, 18 May 2024 08:01:29 +0100 Subject: [PATCH 12/94] fetch key --- config/newrelic.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/newrelic.yml b/config/newrelic.yml index dd41b117..e975b4a4 100644 --- a/config/newrelic.yml +++ b/config/newrelic.yml @@ -12,7 +12,7 @@ common: &default_settings # Required license key associated with your New Relic account. - license_key: ENV.fetch('NEW_RELIC_LICENSE_KEY') + license_key: '<%= ENV["NEW_RELIC_LICENSE_KEY"] %>' # Your application name. Renaming here affects where data displays in New # Relic. For more details, see https://docs.newrelic.com/docs/apm/new-relic-apm/maintenance/renaming-applications From 9fa647465bd3d9d170a44c806f8d3629984fcc9e Mon Sep 17 00:00:00 2001 From: Charlie Cheesman Date: Sat, 18 May 2024 08:15:34 +0100 Subject: [PATCH 13/94] test adding brakeman to github actions --- .github/workflows/rubyonrails.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/rubyonrails.yml b/.github/workflows/rubyonrails.yml index 67d8a841..bd80b58b 100644 --- a/.github/workflows/rubyonrails.yml +++ b/.github/workflows/rubyonrails.yml @@ -59,3 +59,21 @@ jobs: - name: Lint Ruby files run: bundle exec rubocop --parallel + + brakeman: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Install Ruby and gems + uses: ruby/setup-ruby@55283cc23133118229fd3f97f9336ee23a179fcf # v1.146.0 + with: + bundler-cache: true + - name: Install dependencies + run: bundle install + - name: Run Brakeman + run: brakeman -f sarif -o output.sarif.json + - name: Upload SARIF + uses: github/codeql-action/upload-sarif@v2 + with: + sarif_file: output.sarif.json From 9b49a8f770c0ced89773e305905472e6c3f97a09 Mon Sep 17 00:00:00 2001 From: Charlie Cheesman Date: Sat, 18 May 2024 08:20:03 +0100 Subject: [PATCH 14/94] enable brakeman in test environment --- Gemfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 3b4697ab..3a8f0d44 100644 --- a/Gemfile +++ b/Gemfile @@ -124,6 +124,9 @@ group :development, :test do gem 'rubocop-rails' gem 'rubocop-rspec' + # Security + gem 'brakeman', require: false + # Email # gem 'letter_opener' # TODO: install this gem for email testing end @@ -135,9 +138,6 @@ group :development do gem "better_errors" gem "binding_of_caller" - # Security - gem 'brakeman', require: false - # Performance # Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler] # gem "rack-mini-profiler" # TODO: install this gem for performance monitoring From 6ab248de841a33d228449db9de4e942031bd5e70 Mon Sep 17 00:00:00 2001 From: Charlie Cheesman Date: Sat, 18 May 2024 08:23:33 +0100 Subject: [PATCH 15/94] bundle exec --- .github/workflows/rubyonrails.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rubyonrails.yml b/.github/workflows/rubyonrails.yml index bd80b58b..83660f0f 100644 --- a/.github/workflows/rubyonrails.yml +++ b/.github/workflows/rubyonrails.yml @@ -72,7 +72,7 @@ jobs: - name: Install dependencies run: bundle install - name: Run Brakeman - run: brakeman -f sarif -o output.sarif.json + run: bundle exec brakeman -f sarif -o output.sarif.json - name: Upload SARIF uses: github/codeql-action/upload-sarif@v2 with: From 5b90e0c17dbbe7ca28093afc492bcc5cad36a596 Mon Sep 17 00:00:00 2001 From: Charlie Cheesman Date: Sat, 18 May 2024 08:26:19 +0100 Subject: [PATCH 16/94] continue on error --- .github/workflows/rubyonrails.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/rubyonrails.yml b/.github/workflows/rubyonrails.yml index 83660f0f..244200ef 100644 --- a/.github/workflows/rubyonrails.yml +++ b/.github/workflows/rubyonrails.yml @@ -73,6 +73,7 @@ jobs: run: bundle install - name: Run Brakeman run: bundle exec brakeman -f sarif -o output.sarif.json + continue-on-error: true - name: Upload SARIF uses: github/codeql-action/upload-sarif@v2 with: From 551dc24f751e1f259fd740e16e70b2bff15c36a4 Mon Sep 17 00:00:00 2001 From: Charlie Cheesman Date: Sat, 18 May 2024 17:43:55 +0100 Subject: [PATCH 17/94] add hubspot api client --- Gemfile | 3 ++- Gemfile.lock | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 3a8f0d44..0bb7f885 100644 --- a/Gemfile +++ b/Gemfile @@ -77,7 +77,8 @@ gem "ruby-openai" gem 'meta-tags' # gem 'sitemap_generator' # TODO: install this gem for sitemap generation -# Email +# Email & CRM +gem 'hubspot-api-client' # gem 'sendgrid-ruby' # TODO: install this gem for sending emails # Importing, Parsing & APIs diff --git a/Gemfile.lock b/Gemfile.lock index d4d25a32..0d5b0448 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -162,6 +162,8 @@ GEM erubi (1.12.0) et-orbi (1.2.11) tzinfo + ethon (0.16.0) + ffi (>= 1.15.0) event_stream_parser (1.0.0) execjs (2.9.1) factory_bot (6.4.6) @@ -202,6 +204,9 @@ GEM httparty (0.21.0) mini_mime (>= 1.0.0) multi_xml (>= 0.5.2) + hubspot-api-client (18.0.0) + json (~> 2.1, >= 2.1.0) + typhoeus (~> 1.4.0) i18n (1.14.4) concurrent-ruby (~> 1.0) importmap-rails (2.0.1) @@ -436,6 +441,8 @@ GEM railties (>= 6.0.0) turbo_power (0.6.1) turbo-rails (>= 1.3.0) + typhoeus (1.4.1) + ethon (>= 0.9.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicode-display_width (2.5.0) @@ -503,6 +510,7 @@ DEPENDENCIES geocoder high_voltage (~> 3.1) htmltoword + hubspot-api-client importmap-rails json (~> 2.6, >= 2.6.3) meta-tags From 15d7b84ed45778997bfbf958528a9ba370625060 Mon Sep 17 00:00:00 2001 From: Charlie Cheesman Date: Sat, 18 May 2024 17:44:25 +0100 Subject: [PATCH 18/94] add utility class for background color --- app/assets/stylesheets/components/_utility_classes.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/assets/stylesheets/components/_utility_classes.scss b/app/assets/stylesheets/components/_utility_classes.scss index fc003879..075ef706 100644 --- a/app/assets/stylesheets/components/_utility_classes.scss +++ b/app/assets/stylesheets/components/_utility_classes.scss @@ -17,3 +17,7 @@ .small-text { font-size: 0.8rem; } + +.bg-main { + background-color: $main-color; +} From e4939cdcbf225ba32f867c7374d964a742cc7a22 Mon Sep 17 00:00:00 2001 From: Charlie Cheesman Date: Sat, 18 May 2024 17:44:31 +0100 Subject: [PATCH 19/94] update footer --- app/views/pages/_footer.html.erb | 62 ++++++++++++++++---------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/app/views/pages/_footer.html.erb b/app/views/pages/_footer.html.erb index 979bb7e2..80edb272 100644 --- a/app/views/pages/_footer.html.erb +++ b/app/views/pages/_footer.html.erb @@ -1,39 +1,39 @@ -