Skip to content

document our main implementation script - #6

Open
Sara-ShiHo wants to merge 1 commit into
mainfrom
feature/ps1-export
Open

document our main implementation script#6
Sara-ShiHo wants to merge 1 commit into
mainfrom
feature/ps1-export

Conversation

@Sara-ShiHo

@Sara-ShiHo Sara-ShiHo commented Jul 15, 2026

Copy link
Copy Markdown

Description

This is the main implementation script used for Impressions model onboarding

Change Type

  • Patch/Bugfix
  • New Feature
  • Breaking Change

Requirements

  • A Linear ticket included in the PR title
  • Tests added, updated, or confirmed to cover the included code changes

Summary by cubic

Adds a documented PowerShell export script to generate a CSV from the PS database for model training and Impressions onboarding.

  • Migration
    • Rename exports/rad_ai_ps_extraction_script.txt to .ps1 and run in PowerShell (or run the query in SSMS).
    • Set $server and $outfile. Add -Username/-Password if not using Windows auth.
    • Tweak the query: update date range, remove TOP 15000 after sample review, filter by SiteID if needed, and add resident fields (Overread, SecondSignerAcctID) if applicable.

Written for commit c0dec17. Summary will update on new commits.

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

3 issues found across 1 file

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="exports/rad_ai_ps_extraction_script.txt">

<violation number="1" location="exports/rad_ai_ps_extraction_script.txt:20">
P3: Minor typo in comment: "add the follow filed" should read "add the following field". While functionally harmless, this is a customer-facing script and these kinds of errors reduce confidence in the script's quality.</violation>

<violation number="2" location="exports/rad_ai_ps_extraction_script.txt:43">
P2: Importing the deprecated SQLPS module instead of the SqlServer module. SQLPS is no longer packaged with SSMS (16.x+), has no active feature development, and may not be present on systems without a SQL Server installation. Recommend switching to `Import-Module SqlServer` (available via `Install-Module -Name SqlServer` from the PowerShell Gallery) and ensuring the Invoke-Sqlcmd calls remain compatible.</violation>

<violation number="3" location="exports/rad_ai_ps_extraction_script.txt:47">
P1: The credential pattern here encourages storing database credentials in plaintext within the script file. If this script is saved, shared, or committed anywhere (even temporarily), the passwords are exposed in cleartext. Consider using Windows Authentication (already supported), prompting interactively with `$credential = Get-Credential` and passing `-Credential $credential`, or reading from a secure credential file. If plaintext is unavoidable in the customer's environment, at minimum add a warning comment about never checking this file into source control.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic



########################### ONLY IF NOT USING WINDOWS AUTH ###########################
$username = "replace with username" # specify if not using Windows auth

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1: The credential pattern here encourages storing database credentials in plaintext within the script file. If this script is saved, shared, or committed anywhere (even temporarily), the passwords are exposed in cleartext. Consider using Windows Authentication (already supported), prompting interactively with $credential = Get-Credential and passing -Credential $credential, or reading from a secure credential file. If plaintext is unavoidable in the customer's environment, at minimum add a warning comment about never checking this file into source control.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At exports/rad_ai_ps_extraction_script.txt, line 47:

<comment>The credential pattern here encourages storing database credentials in plaintext within the script file. If this script is saved, shared, or committed anywhere (even temporarily), the passwords are exposed in cleartext. Consider using Windows Authentication (already supported), prompting interactively with `$credential = Get-Credential` and passing `-Credential $credential`, or reading from a secure credential file. If plaintext is unavoidable in the customer's environment, at minimum add a warning comment about never checking this file into source control.</comment>

<file context>
@@ -0,0 +1,73 @@
+
+
+########################### ONLY IF NOT USING WINDOWS AUTH ###########################
+$username = "replace with username"    # specify if not using Windows auth
+$password = "replace with password"    # specify if not using Windows auth
+
</file context>

$outfile = ".\radai-results.csv" # Name of output CSV (file will be overwritten unless renamed)

Push-Location $PWD
Import-Module SQLPS

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: Importing the deprecated SQLPS module instead of the SqlServer module. SQLPS is no longer packaged with SSMS (16.x+), has no active feature development, and may not be present on systems without a SQL Server installation. Recommend switching to Import-Module SqlServer (available via Install-Module -Name SqlServer from the PowerShell Gallery) and ensuring the Invoke-Sqlcmd calls remain compatible.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At exports/rad_ai_ps_extraction_script.txt, line 43:

<comment>Importing the deprecated SQLPS module instead of the SqlServer module. SQLPS is no longer packaged with SSMS (16.x+), has no active feature development, and may not be present on systems without a SQL Server installation. Recommend switching to `Import-Module SqlServer` (available via `Install-Module -Name SqlServer` from the PowerShell Gallery) and ensuring the Invoke-Sqlcmd calls remain compatible.</comment>

<file context>
@@ -0,0 +1,73 @@
+$outfile = ".\radai-results.csv"       # Name of output CSV (file will be overwritten unless renamed)
+
+Push-Location $PWD
+Import-Module SQLPS
+
+
</file context>

#
# To limit the results to specific sites, add "[ORDER].SiteID in (1, 2, 3)" to the WHERE clause
#
# If residents are part of workflow, add the follow filed to the SELECT statement:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: Minor typo in comment: "add the follow filed" should read "add the following field". While functionally harmless, this is a customer-facing script and these kinds of errors reduce confidence in the script's quality.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At exports/rad_ai_ps_extraction_script.txt, line 20:

<comment>Minor typo in comment: "add the follow filed" should read "add the following field". While functionally harmless, this is a customer-facing script and these kinds of errors reduce confidence in the script's quality.</comment>

<file context>
@@ -0,0 +1,73 @@
+#  
+#  To limit the results to specific sites, add "[ORDER].SiteID in (1, 2, 3)" to the WHERE clause
+#
+#  If residents are part of workflow, add the follow filed to the SELECT statement:
+#  ", Report.Overread AS Overread, Report.SecondSignerAcctID"
+
</file context>

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.

1 participant