Skip to content

Commit

Permalink
feat: sfify
Browse files Browse the repository at this point in the history
* feat: sfify

* chore: noop the docs

* chore: bump prettier (to close other pr)

* test: better NUT error output

* test: nuts on multiple branches can't run in parallel

* test: use parameterized nut secrets

* chore: more parameterized secrets

* chore: bump lots of deps

* test: assert hub org username

* test: change to  runner that can talk to org

* chore: bump more deps

* test: use gha main

* refactor: typed return
  • Loading branch information
mshanemc authored Apr 4, 2023
1 parent e0630a5 commit 53ae736
Show file tree
Hide file tree
Showing 38 changed files with 4,013 additions and 3,574 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
module.exports = {
extends: ['eslint-config-salesforce-typescript', 'eslint-config-salesforce-license'],
extends: ['eslint-config-salesforce-typescript', 'eslint-config-salesforce-license', 'plugin:sf-plugin/migration'],
rules: {
camelcase: 'off',
'sf-plugin/get-connection-with-version': 'off',
},
};
25 changes: 16 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,22 @@ on:
workflow_dispatch:

jobs:
unit-tests:
uses: salesforcecli/github-workflows/.github/workflows/unitTest.yml@main
yarn-lockfile-check:
uses: salesforcecli/github-workflows/.github/workflows/lockFileCheck.yml@main
linux-unit-tests:
needs: yarn-lockfile-check
uses: salesforcecli/github-workflows/.github/workflows/unitTestsLinux.yml@main
nuts:
needs: unit-tests
concurrency:
group: ${{ github.repository }}
needs: linux-unit-tests
uses: salesforcecli/github-workflows/.github/workflows/nut.yml@main
secrets: inherit
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
fail-fast: false
secrets:
SF_CHANGE_CASE_SFDX_AUTH_URL: ${{ secrets.SF_CHANGE_CASE_SFDX_AUTH_URL }}
TESTKIT_AUTH_URL: ${{ secrets.TESTKIT_AUTH_URL }}
SF_CHANGE_CASE_TEMPLATE_ID: ${{ secrets.SF_CHANGE_CASE_TEMPLATE_ID }}
SF_CHANGE_CASE_CONFIGURATION_ITEM: ${{ secrets.SF_CHANGE_CASE_CONFIGURATION_ITEM }}
with:
os: ${{ matrix.os }}
# these are never meant to run on windows
# only static-ip runners can talk to the org
os: static-ip-ubuntu-runners
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,12 @@ docs
*.tgz
*.sig
package.json.bak.
.sfdx

# -- CLEAN ALL
*.tsbuildinfo
.eslintcache
.wireit
node_modules

# --
Expand Down
1 change: 1 addition & 0 deletions .mocharc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"require": "ts-node/register,source-map-support/register",
"watch-extensions": "ts",
"watch-files": ["src/**/*.ts", "test/**/*.ts"],
"recursive": true,
"reporter": "spec",
"timeout": 5000
Expand Down
9 changes: 9 additions & 0 deletions .sfdevrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"wireit": {
"test:command-reference": {
"command": "echo \"We don't do docs for this command\"",
"files": ["src/**/*.ts", "messages/**"],
"output": ["tmp/root"]
}
}
}
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2022, Salesforce.com, Inc.
Copyright (c) 2023, Salesforce.com, Inc.
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Expand Down
21 changes: 21 additions & 0 deletions bin/dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env node

const oclif = require('@oclif/core');

const path = require('path');
const project = path.join(__dirname, '..', 'tsconfig.json');

// In dev mode -> use ts-node and dev plugins
process.env.NODE_ENV = 'development';

// Enable SWC for faster typescript compiling
require('ts-node').register({ project, swc: true });

// In dev mode, always show stack traces
const g = (global.oclif = global.oclif || {});

// In dev mode, always show stack traces
global.oclif.debug = true;

// Start the CLI
oclif.run().then(require('@oclif/core/flush')).catch(require('@oclif/core/handle'));
3 changes: 3 additions & 0 deletions bin/dev.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off

node "%~dp0\dev" %*
3 changes: 1 addition & 2 deletions bin/run
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env node

require('@oclif/command').run()
.catch(require('@oclif/errors/handle'))
require('@oclif/core').run().then(require('@oclif/core/flush')).catch(require('@oclif/core/handle'));
46 changes: 6 additions & 40 deletions command-snapshot.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,53 +2,19 @@
{
"command": "check",
"plugin": "@salesforce/change-case-management",
"flags": [
"apiversion",
"bypass",
"changecaseid",
"dryrun",
"json",
"location",
"loglevel",
"release",
"targetusername"
]
"flags": ["change-case-id", "json", "location", "release", "target-org"],
"alias": []
},
{
"command": "close",
"plugin": "@salesforce/change-case-management",
"flags": [
"apiversion",
"bypass",
"changecaseid",
"dryrun",
"json",
"location",
"loglevel",
"release",
"status",
"targetusername"
]
"flags": ["change-case-id", "dry-run", "json", "location", "release", "status", "target-org"],
"alias": []
},
{
"command": "create",
"plugin": "@salesforce/change-case-management",
"flags": [
"apiversion",
"bypass",
"configurationitem",
"dryrun",
"json",
"location",
"loglevel",
"release",
"targetusername",
"templateid"
]
},
{
"command": "updateScheduledBuild",
"plugin": "@salesforce/change-case-management",
"flags": ["apiversion", "bypass", "dryrun", "json", "loglevel", "targetusername", "workitemid", "scheduledbuild"]
"flags": ["configuration-item", "dry-run", "json", "location", "release", "target-org", "template-id"],
"alias": []
}
]
38 changes: 0 additions & 38 deletions messages/changecase.json

This file was deleted.

43 changes: 43 additions & 0 deletions messages/changecase.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# check.description

check the status of a change case record

# create.description

create a change case record based on a template ID with one implementation step

# create.flags.templateid.description

change case template id

# create.flags.release.description

schedule build of the new release

# create.flags.location.description

url of the source control location

# create.flags.configurationitem.description

Full path from the configuration item, ex: Salesforce.SF_Off_Core.DeveloperTools.NPM

# close.description

stops the implementation steps, and closes the change case record

# command.flags.changecaseid.description

change case id

# command.flags.dryrun.description

run the command without making any API calls - all calls will be 'successful'

# close.flags.status.summary

What the status of the implementation steps should be set to

# NoOrgError

The command needs either a target org specified via flag or an environment variable: %s
5 changes: 0 additions & 5 deletions messages/workitem.json

This file was deleted.

Loading

0 comments on commit 53ae736

Please sign in to comment.