Skip to content

Conversation

@rileyseaburg
Copy link
Contributor

No description provided.

ryanwoldatwork and others added 26 commits February 4, 2025 16:37
* to trigger an automated import of CxResponses
* because expiration is now a date_field
Bumps [pbkdf2](https://github.com/crypto-browserify/pbkdf2) from 3.1.2 to 3.1.3.
- [Changelog](https://github.com/browserify/pbkdf2/blob/master/CHANGELOG.md)
- [Commits](browserify/pbkdf2@v3.1.2...v3.1.3)

---
updated-dependencies:
- dependency-name: pbkdf2
  dependency-version: 3.1.3
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-RUBY-RACK-10303186
Signed-off-by: Jonathan Hutchison <jonathanhutchison@navapbc.com>
Signed-off-by: Riley Seaburg <riley.seaburg@gsa.gov>
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.18.8 to 1.18.9.
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md)
- [Commits](sparklemotion/nokogiri@v1.18.8...v1.18.9)

---
updated-dependencies:
- dependency-name: nokogiri
  dependency-version: 1.18.9
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [thor](https://github.com/rails/thor) from 1.3.2 to 1.4.0.
- [Release notes](https://github.com/rails/thor/releases)
- [Commits](rails/thor@v1.3.2...v1.4.0)

---
updated-dependencies:
- dependency-name: thor
  dependency-version: 1.4.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Riley Seaburg <riley.seaburg@gsa.gov>

This comment was marked as outdated.

if questions.size > 12
errors.add(:base, "Touchpoints supports a maximum of 20 questions. There are currently #{questions_count} questions. Fewer questions tend to yield higher response rates.")
end
errors.add(:base, "Touchpoints supports a maximum of 30 questions. There are currently #{questions_count} questions. Fewer questions tend to yield higher response rates.") if questions.size > 20
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MrNagoo we need to change this to 30 right?

Copy link
Contributor

@MrNagoo MrNagoo Aug 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rileyseaburg This is actually the warning for when you're adding too many questions. It used to warn at 12 to get a total of 20, now it will start warning you at 20 to get a total of 30. If we move to >= 30 it will never warn because there isn't an option of going beyond 30.

Sorry I didn't see this sooner

rileyseaburg and others added 13 commits August 11, 2025 11:40
Update question limit warning logic in form test
Signed-off-by: Riley Seaburg <riley.seaburg@gsa.gov>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Riley Seaburg <riley@rileyseaburg.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Riley Seaburg <riley@rileyseaburg.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Riley Seaburg <riley@rileyseaburg.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Riley Seaburg <riley@rileyseaburg.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Riley Seaburg <riley@rileyseaburg.com>
…-a11

pre-fill Cx Collection Detail if using an A11 form
@rileyseaburg rileyseaburg requested a review from Copilot August 11, 2025 17:09
@rileyseaburg rileyseaburg self-assigned this Aug 11, 2025
@rileyseaburg rileyseaburg merged commit 6edab61 into production Aug 11, 2025
5 of 6 checks passed
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This is a production release that significantly expands form capacity by adding support for 10 additional answer fields (21-30) and introduces new A-11 v2 form integration features with CX Collections. The release also includes various code style improvements and minor bug fixes.

  • Increases the maximum number of form questions from 20 to 30 with corresponding schema and API updates
  • Adds integration between A-11 v2 forms and CX Collections for automated response data transfer
  • Updates dependencies and implements code style improvements with consistent single-quote usage

Reviewed Changes

Copilot reviewed 30 out of 33 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
db/migrate/20250717034402_increase_submission_questions.rb Adds 10 new answer columns (answer_21 to answer_30) to submissions table
app/models/form.rb Updates question limit validation from 20 to 30 and extensive code style refactoring
app/controllers/admin/questions_controller.rb Updates answer field range from 1-20 to 1-30
app/serializers/submission_serializer.rb Adds serialization support for new answer fields 21-30
public/api/v1/openapi.yml Documents new answer fields in API v1 specification
public/api/v0/openapi.yml Documents new answer fields in API v0 specification
spec/models/form_spec.rb Adds tests for new question limit validation
lib/fiscal_year.rb Implements fiscal_quarter_dates method for date range calculations
app/models/cx_collection_detail.rb Adds optional form association
app/controllers/admin/cx_collection_details_controller.rb Adds form integration logic for CX collection details

# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[8.0].define(version: 2025_04_23_163606) do
ActiveRecord::Schema[8.0].define(version: 20_250_717_034_402) do
Copy link

Copilot AI Aug 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The schema version format appears to have incorrect underscores. Rails migration timestamps should be formatted as '20250717034402', not '20_250_717_034_402'.

Suggested change
ActiveRecord::Schema[8.0].define(version: 20_250_717_034_402) do
ActiveRecord::Schema[8.0].define(version: 20250717034402) do

Copilot uses AI. Check for mistakes.
t.string 'variation_digest', null: false
t.index %w[blob_id variation_digest], name: 'index_active_storage_variant_records_uniqueness', unique: true
end

Copy link

Copilot AI Aug 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The schema file contains duplicate table definitions and enable_extension calls starting at line 780. This appears to be a merge conflict or duplicate content that should be removed.

Suggested change

Copilot uses AI. Check for mistakes.
gem 'rack-cors', require: 'rack/cors'
# Use Redis to cache Touchpoints in all envs
gem 'rack-cors', '>= 3.0.0', require: 'rack/cors'
# Use Redis to cache Touchpoints in all envs=
Copy link

Copilot AI Aug 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's an extra '=' character at the end of the comment line.

Suggested change
# Use Redis to cache Touchpoints in all envs=
# Use Redis to cache Touchpoints in all envs

Copilot uses AI. Check for mistakes.
gem 'redis-client'
gem 'redis-namespace'
gem 'rolify'
gem 'sidekiq', '>= 6.5.0'
Copy link

Copilot AI Aug 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sidekiq gem is declared twice with different version constraints ('>= 8.0.4' on line 69 and '>= 6.5.0' on line 79). This creates conflicting requirements and the duplicate should be removed.

Suggested change
gem 'sidekiq', '>= 6.5.0'

Copilot uses AI. Check for mistakes.
gem 'json-jwt'
gem 'aasm'
gem 'acts-as-taggable-on'
gem 'json-jwt'
Copy link

Copilot AI Aug 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'json-jwt' gem is declared twice (lines 70 and 73). The duplicate declaration should be removed.

Suggested change
gem 'json-jwt'

Copilot uses AI. Check for mistakes.
gem 'acts-as-taggable-on'
gem "rolify"
gem 'redis-client'
gem 'redis-namespace'
Copy link

Copilot AI Aug 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'redis-namespace' gem is declared twice (lines 68 and 77). The duplicate declaration should be removed.

Suggested change
gem 'redis-namespace'

Copilot uses AI. Check for mistakes.
.order('created_at')
return nil if non_flagged_submissions.blank?

answer_02_options = self.questions.where(answer_field: "answer_02").first.question_options.collect(&:value)
Copy link

Copilot AI Aug 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Using 'self.' is unnecessary in this context and inconsistent with the style changes in the rest of the file. Should be 'questions.where(answer_field: "answer_02")' to match the refactoring pattern used elsewhere.

Suggested change
answer_02_options = self.questions.where(answer_field: "answer_02").first.question_options.collect(&:value)
answer_02_options = questions.where(answer_field: "answer_02").first.question_options.collect(&:value)

Copilot uses AI. Check for mistakes.
def warn_about_not_too_many_questions
if questions.size > 12
errors.add(:base, "Touchpoints supports a maximum of 20 questions. There are currently #{questions_count} questions. Fewer questions tend to yield higher response rates.")
if questions.size >= 30
Copy link

Copilot AI Aug 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The condition should use '>' instead of '>=' since the error message indicates 30 questions is the maximum allowed. Currently, forms with exactly 30 questions will trigger the warning when they should be valid.

Suggested change
if questions.size >= 30
if questions.size > 30

Copilot uses AI. Check for mistakes.
def process_csv_in_a_worker
process_csv
def process_records_in_a_worker
if self.key?
Copy link

Copilot AI Aug 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Using 'self.' is unnecessary here. Should be 'if key?' to follow Ruby conventions.

Suggested change
if self.key?
if key?

Copilot uses AI. Check for mistakes.
@cx_collection_detail.form = @form
@cx_collection_detail.service_stage_id = @form.service_stage_id
@cx_collection_detail.transaction_point = 'post_interaction'
@cx_collection_detail.survey_type = 'thumbs_up_down' if @form.kind == "a11_v2"
Copy link

Copilot AI Aug 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Inconsistent quote usage. Should use single quotes for 'a11_v2' to match the style used for 'thumbs_up_down'.

Suggested change
@cx_collection_detail.survey_type = 'thumbs_up_down' if @form.kind == "a11_v2"
@cx_collection_detail.survey_type = 'thumbs_up_down' if @form.kind == 'a11_v2'

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants