with one click
reset-prod-submissions
// Reset verification submissions for a user in production. Use when user says "reset prod submissions", "reset phase X in prod", "undo prod verification", or "reset prod for <username>".
// Reset verification submissions for a user in production. Use when user says "reset prod submissions", "reset phase X in prod", "undo prod verification", or "reset prod for <username>".
Attach relevant Copilot session lessons, mistakes, decisions, model details, token usage, MCP servers, and skills to a GitHub issue comment. Use when the user asks to add session notes, lessons learned, Copilot notes, mistakes, or implementation details to an issue.
Run ruff lint, ruff format, ty type-check, shared/API tests, start the API, smoke test endpoints, then kill the API. Use after editing Python files to catch errors before commit.
Run prek, run tests, resolve issues, commit, push, then monitor the deploy workflow and resolve any deploy failures. Use when user says "ship it", "commit and deploy", "push and deploy", or "land this".
Map concepts, issues, and code changes in this repo to specific chapters and pages of Fluent Python, 2nd edition (Luciano Ramalho). Use when the user wants to ground a task in the underlying Python concept, e.g. "where is this in fluent python?", "what should I read for
Undo local submissions for DevOps and Verify Journal API Implementation so you can re-test verification flows. Also supports custom requirement IDs and user scoping.
Debug GitHub Actions workflow failures and Terraform errors. Use when deployment failed, Terraform state lock, CI/CD pipeline errors, or troubleshooting deploy.yml.
| name | reset-prod-submissions |
| description | Reset verification submissions for a user in production. Use when user says "reset prod submissions", "reset phase X in prod", "undo prod verification", or "reset prod for <username>". |
Use this skill to delete submission records and reset phase progress counters in the production database.
Requires Azure CLI auth with access to the rg-ltc-dev resource group and Entra ID token for PostgreSQL.
If the connection is refused, add a firewall rule for the current IP:
MY_IP=$(curl -s ifconfig.me)
az rest --method put \
--url "https://management.azure.com/subscriptions/$(az account show --query id -o tsv)/resourceGroups/rg-ltc-dev/providers/Microsoft.DBforPostgreSQL/flexibleServers/psql-ltc-dev-8v4tyz/firewallRules/AllowDevContainer?api-version=2022-12-01" \
--body "{\"properties\":{\"startIpAddress\":\"$MY_IP\",\"endIpAddress\":\"$MY_IP\"}}"
Wait ~30 seconds for the rule to propagate before connecting.
export PGPASSWORD=$(az account get-access-token --resource-type oss-rdbms --query accessToken -o tsv)
export PG_USER=$(az ad signed-in-user show --query displayName -o tsv)
Agent usage: Always use
-P pager=offand pipe through| catto avoid blocking.
The hostname is psql-ltc-dev-8v4tyz.postgres.database.azure.com, database learntocloud.
If it changes, find the current one with: az resource list --resource-group rg-ltc-dev --resource-type "Microsoft.DBforPostgreSQL/flexibleServers" --query "[].name" -o tsv
psql -h psql-ltc-dev-8v4tyz.postgres.database.azure.com -d learntocloud -U "$PG_USER" \
--set=sslmode=require -P pager=off \
-c "SELECT id, github_username FROM users WHERE github_username = '<USERNAME>';" | cat
Before deleting, show what will be removed:
psql -h psql-ltc-dev-8v4tyz.postgres.database.azure.com -d learntocloud -U "$PG_USER" \
--set=sslmode=require -P pager=off \
-c "SELECT id, phase_id, requirement_id, submission_type, is_validated, attempt_number, created_at
FROM submissions
WHERE user_id = <USER_ID> AND phase_id = <PHASE_ID>
ORDER BY created_at;" | cat
Also check the current validated submissions for this phase:
psql -h psql-ltc-dev-8v4tyz.postgres.database.azure.com -d learntocloud -U "$PG_USER" \
--set=sslmode=require -P pager=off \
-c "SELECT COUNT(*) FROM submissions
WHERE user_id = <USER_ID> AND phase_id = <PHASE_ID> AND is_validated = true;" | cat
Always ask for confirmation before deleting. Show the number of rows and what phase is being reset.
Run as a single transaction:
psql -h psql-ltc-dev-8v4tyz.postgres.database.azure.com -d learntocloud -U "$PG_USER" \
--set=sslmode=require -P pager=off \
-c "
BEGIN;
DELETE FROM submissions WHERE user_id = <USER_ID> AND phase_id = <PHASE_ID>;
COMMIT;
" | cat
Progress is derived live from the submissions table, so no separate counter table needs to be updated.
To reset only certain requirements within a phase instead of the whole phase:
psql -h psql-ltc-dev-8v4tyz.postgres.database.azure.com -d learntocloud -U "$PG_USER" \
--set=sslmode=require -P pager=off \
-c "
BEGIN;
DELETE FROM submissions
WHERE user_id = <USER_ID> AND phase_id = <PHASE_ID>
AND requirement_id IN ('<REQ_1>', '<REQ_2>');
COMMIT;
" | cat
Confirm the reset was successful:
psql -h psql-ltc-dev-8v4tyz.postgres.database.azure.com -d learntocloud -U "$PG_USER" \
--set=sslmode=require -P pager=off \
-c "SELECT COUNT(*) as remaining FROM submissions WHERE user_id = <USER_ID> AND phase_id = <PHASE_ID>;
SELECT COUNT(*) as validated FROM submissions
WHERE user_id = <USER_ID> AND phase_id = <PHASE_ID> AND is_validated = true;" | cat
| GitHub Username | User ID |
|---|---|
| madebygps | 6733686 |
users ยท submissions