Skip to content

Commit

Permalink
[EASI-4586] Add AI Question to System Intake and as Subject Area for …
Browse files Browse the repository at this point in the history
…TRB (#2773)

* Add AI question to system intake

* Add AI to TRB Subject Area Enum

* Update dev data, tests, and snapshots for new AI fields in governance flows

* More test and mock data changes

* Add AI mailbox to External URL constants

* Final language tweaks for new system intake AI question, add form validation

* Add new system intake AI question/answer to CSV exports

* Update snapshots and add more tests for AI system intake question

* Update cypress tests to include system intake AI question
  • Loading branch information
downeyn-cms committed Aug 28, 2024
1 parent 7a78e05 commit 33fe42a
Show file tree
Hide file tree
Showing 38 changed files with 274 additions and 4 deletions.
3 changes: 3 additions & 0 deletions cmd/devdata/system_intake.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ func fillOutInitialIntake(
"An intense business need",
"with a great business solution",
true,
true,
"Some CEDAR System ID",
"the current stage",
true,
Expand Down Expand Up @@ -189,6 +190,7 @@ func updateSystemIntakeRequestDetails(
businessNeed string,
businessSolution string,
needsEaSupport bool,
usesAiTech bool,
currentStage string,
cedarSystemID string,
hasUIChanges bool,
Expand All @@ -199,6 +201,7 @@ func updateSystemIntakeRequestDetails(
BusinessNeed: &businessNeed,
BusinessSolution: &businessSolution,
NeedsEaSupport: &needsEaSupport,
UsesAiTech: &usesAiTech,
CurrentStage: &currentStage,
CedarSystemID: &cedarSystemID,
HasUIChanges: &hasUIChanges,
Expand Down
1 change: 1 addition & 0 deletions cmd/devdata/trb_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,7 @@ func (s *seederConfig) seedTRBWithForm(ctx context.Context, trbName *string, isS
"collabDateOther": "Last week",
"collabGRBConsultRequested": true,
"subjectAreaOptions": []models.TRBSubjectAreaOption{
models.TRBSubjectAreaOptionArtificialIntelligence,
models.TRBSubjectAreaOptionAssistanceWithSystemConceptDev,
models.TRBSubjectAreaOptionCloudMigration,
},
Expand Down
2 changes: 2 additions & 0 deletions cypress/support/systemIntake.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ cy.systemIntake = {
.type('This is my business solution.')
.should('have.value', 'This is my business solution.');

cy.get('#usesAiTechTrue').check({ force: true }).should('be.checked');

cy.get('#needsEaSupportFalse')
.check({ force: true })
.should('be.checked');
Expand Down
1 change: 1 addition & 0 deletions migrations/V187__Add_AI_Question_To_System_Intake.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE system_intakes ADD COLUMN uses_ai_tech BOOLEAN;
1 change: 1 addition & 0 deletions migrations/V188__Add_AI_TRB_Subject_Area.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TYPE subject_area_option ADD VALUE 'ARTIFICIAL_INTELLIGENCE';
89 changes: 88 additions & 1 deletion pkg/graph/generated/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pkg/graph/resolvers/system_intake.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ func SystemIntakeUpdate(ctx context.Context, store *storage.Store, fetchCedarSys
intake.Solution = null.StringFromPtr(input.BusinessSolution)
intake.EASupportRequest = null.BoolFromPtr(input.NeedsEaSupport)
intake.HasUIChanges = null.BoolFromPtr(input.HasUIChanges)
intake.UsesAITech = null.BoolFromPtr(input.UsesAiTech)

cedarSystemID := null.StringFromPtr(input.CedarSystemID)
cedarSystemIDStr := cedarSystemID.ValueOrZero()
Expand Down
3 changes: 3 additions & 0 deletions pkg/graph/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,7 @@ type SystemIntake {
cedarSystemId: String
documents: [SystemIntakeDocument!]!
hasUiChanges: Boolean
usesAiTech: Boolean
itGovTaskStatuses: ITGovTaskStatuses!
requestFormState: SystemIntakeFormState!
draftBusinessCaseState: SystemIntakeFormState!
Expand Down Expand Up @@ -958,6 +959,7 @@ input UpdateSystemIntakeRequestDetailsInput {
currentStage: String
cedarSystemId: String
hasUiChanges: Boolean
usesAiTech: Boolean
}

"""
Expand Down Expand Up @@ -1920,6 +1922,7 @@ The possible options on the TRB "Subject Areas" page
enum TRBSubjectAreaOption {
ACCESS_CONTROL_AND_IDENTITY_MANAGEMENT
ACCESSIBILITY_COMPLIANCE
ARTIFICIAL_INTELLIGENCE
ASSISTANCE_WITH_SYSTEM_CONCEPT_DEVELOPMENT
BUSINESS_INTELLIGENCE
CLOUD_MIGRATION
Expand Down
10 changes: 10 additions & 0 deletions pkg/graph/schema.resolvers_system_intake_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1130,6 +1130,7 @@ func (s *GraphQLTestSuite) TestUpdateRequestDetails() {
CurrentStage string
NeedsEaSupport bool
HasUIChanges bool
UsesAiTech bool
}
}
}
Expand All @@ -1146,6 +1147,7 @@ func (s *GraphQLTestSuite) TestUpdateRequestDetails() {
currentStage: "Just an idea",
needsEaSupport: false,
hasUiChanges: false,
usesAiTech: true,
}) {
systemIntake {
id
Expand All @@ -1155,6 +1157,7 @@ func (s *GraphQLTestSuite) TestUpdateRequestDetails() {
currentStage
needsEaSupport
hasUiChanges
usesAiTech
}
}
}`, intake.ID), &resp)
Expand All @@ -1168,6 +1171,7 @@ func (s *GraphQLTestSuite) TestUpdateRequestDetails() {
s.Equal(respIntake.CurrentStage, "Just an idea")
s.False(respIntake.NeedsEaSupport)
s.False(respIntake.HasUIChanges)
s.True(respIntake.UsesAiTech)
}

func (s *GraphQLTestSuite) TestUpdateRequestDetailsHasUiChangesNull() {
Expand All @@ -1183,6 +1187,7 @@ func (s *GraphQLTestSuite) TestUpdateRequestDetailsHasUiChangesNull() {
UpdateSystemIntakeRequestDetails struct {
SystemIntake struct {
ID string
UsesAiTech *bool
HasUIChanges *bool
}
}
Expand All @@ -1192,10 +1197,12 @@ func (s *GraphQLTestSuite) TestUpdateRequestDetailsHasUiChangesNull() {
`mutation {
updateSystemIntakeRequestDetails(input: {
id: "%s",
usesAiTech: null,
hasUiChanges: null,
}) {
systemIntake {
id
usesAiTech
hasUiChanges
}
}
Expand All @@ -1220,6 +1227,7 @@ func (s *GraphQLTestSuite) TestUpdateRequestDetailsHasUiChangesTrue() {
UpdateSystemIntakeRequestDetails struct {
SystemIntake struct {
ID string
UsesAiTech *bool
HasUIChanges *bool
}
}
Expand All @@ -1229,10 +1237,12 @@ func (s *GraphQLTestSuite) TestUpdateRequestDetailsHasUiChangesTrue() {
`mutation {
updateSystemIntakeRequestDetails(input: {
id: "%s",
usesAiTech: true,
hasUiChanges: true,
}) {
systemIntake {
id
usesAiTech
hasUiChanges
}
}
Expand Down
Loading

0 comments on commit 33fe42a

Please sign in to comment.