Some checks are pending
Bidi Control Character Guard / bidi-control-guard (push) Waiting to run
Circular Dependency Check / Check for new circular dependencies (push) Waiting to run
Citus Migration Smoke / Combined migrations on single-node Citus (push) Waiting to run
E2E Fresh Install Tests / fresh-install-e2e (push) Waiting to run
ext-v2 guardrails / Run ext-v2 guard and ESLint (push) Waiting to run
Integration Tests / Check for relevant changes (push) Waiting to run
Integration Tests / ${{ (github.event_name == 'schedule' || github.event.inputs.suite == 'full') && 'Full integration suite' || 'Tier-1 integration subset' }} (push) Blocked by required conditions
Mobile checks / Mobile lint + typecheck (push) Waiting to run
Mobile checks / Mobile unit tests (push) Waiting to run
Mobile checks / Mobile dependency audit (report) (push) Waiting to run
Mobile checks / Mobile reproducibility checks (push) Waiting to run
Secrets guard (env backups) / Ensure no tracked env backup files (push) Waiting to run
Temporal Readiness / fast-readiness (push) Waiting to run
Temporal Readiness / docker-parity (push) Waiting to run
TypeScript Type Check / Nx affected typecheck (push) Waiting to run
Unit Tests / Skipped-test budget (push) Waiting to run
Unit Tests / Nx affected unit tests (push) Waiting to run
Unit Tests / Server unit coverage (informational) (push) Waiting to run
Validate Tenant Management Schema / Check for relevant changes (push) Waiting to run
Validate Tenant Management Schema / Validate Tenant Management Schema (push) Blocked by required conditions
EE Workflows Build Guard / ee-workflows-build-guard (push) Waiting to run
Excluded: .git, node_modules, secrets/, compose.env, assemblyscript tgz Source: /opt/alga-psa on psa.joliet.tech
125 lines
3.7 KiB
JavaScript
125 lines
3.7 KiB
JavaScript
import { RuleTester } from 'eslint';
|
|
import migrationFilename from './migration-filename.js';
|
|
|
|
const ruleTester = new RuleTester({
|
|
parserOptions: {
|
|
ecmaVersion: 2020,
|
|
sourceType: 'commonjs',
|
|
},
|
|
});
|
|
|
|
ruleTester.run('migration-filename', migrationFilename, {
|
|
valid: [
|
|
{
|
|
// Old migration before cutoff date (20251118) - grandfathered in even with wrong format
|
|
code: 'exports.up = function(knex) {};',
|
|
filename: '/app/server/migrations/20241002132600_add_tax_rates_tables.cjs',
|
|
},
|
|
{
|
|
// Old migration from 2024 - grandfathered in
|
|
code: 'exports.up = function(knex) {};',
|
|
filename: '/app/server/migrations/202409071803_initial_schema.cjs',
|
|
},
|
|
{
|
|
// Migration from November 17, 2025 - grandfathered in
|
|
code: 'exports.up = function(knex) {};',
|
|
filename: '/app/server/migrations/20251117191500_add_dns_lookup_results_to_email_domains.cjs',
|
|
},
|
|
{
|
|
// Migration from November 2, 2025 with 14-digit format - grandfathered in
|
|
code: 'exports.up = function(knex) {};',
|
|
filename: '/app/server/migrations/20251102090000_create_import_framework_tables.cjs',
|
|
},
|
|
{
|
|
// Migration from November 4, 2025 with 14-digit format - grandfathered in
|
|
code: 'exports.up = function(knex) {};',
|
|
filename: '/app/server/migrations/20251104112815_add_hourly_fields_to_contract_lines.cjs',
|
|
},
|
|
{
|
|
// File not in migrations directory should be ignored
|
|
code: 'console.log("test");',
|
|
filename: '/app/server/lib/202599991231_not_a_migration.cjs',
|
|
},
|
|
{
|
|
// Non-.cjs file in migrations directory should be ignored
|
|
code: 'console.log("test");',
|
|
filename: '/app/server/migrations/README.md',
|
|
},
|
|
],
|
|
|
|
invalid: [
|
|
{
|
|
// Future timestamp - December 31, 2099 (after cutoff date)
|
|
code: 'exports.up = function(knex) {};',
|
|
filename: '/app/server/migrations/209912312359_future_migration.cjs',
|
|
errors: [
|
|
{
|
|
messageId: 'futureTimestamp',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
// Invalid format - 10 digits instead of 12/14 (after cutoff, but before grandfathering makes it moot, we use future date)
|
|
code: 'exports.up = function(knex) {};',
|
|
filename: '/app/server/migrations/2099112016_wrong_format.cjs',
|
|
errors: [
|
|
{
|
|
messageId: 'invalidFormat',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
// Missing underscore separator (after cutoff, use far future to avoid timestamp validation)
|
|
code: 'exports.up = function(knex) {};',
|
|
filename: '/app/server/migrations/209911201430add_users.cjs',
|
|
errors: [
|
|
{
|
|
messageId: 'invalidFormat',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
// Invalid timestamp - month 13 (after cutoff)
|
|
code: 'exports.up = function(knex) {};',
|
|
filename: '/app/server/migrations/209913201430_invalid_month.cjs',
|
|
errors: [
|
|
{
|
|
messageId: 'invalidTimestamp',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
// Invalid timestamp - day 32 (after cutoff)
|
|
code: 'exports.up = function(knex) {};',
|
|
filename: '/app/server/migrations/209911321430_invalid_day.cjs',
|
|
errors: [
|
|
{
|
|
messageId: 'invalidTimestamp',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
// Invalid timestamp - hour 25 (after cutoff)
|
|
code: 'exports.up = function(knex) {};',
|
|
filename: '/app/server/migrations/209911202530_invalid_hour.cjs',
|
|
errors: [
|
|
{
|
|
messageId: 'invalidTimestamp',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
// Invalid timestamp - minute 60 (after cutoff)
|
|
code: 'exports.up = function(knex) {};',
|
|
filename: '/app/server/migrations/209911201460_invalid_minute.cjs',
|
|
errors: [
|
|
{
|
|
messageId: 'invalidTimestamp',
|
|
},
|
|
],
|
|
},
|
|
],
|
|
});
|
|
|
|
console.log('All tests passed!');
|