Skip to content

Copado, GitHub, AWS and ServiceNow

Salesforce, Dynatrace and the database have pages of their own. This page covers four more systems we read every day: Copado for where a Salesforce change is, GitHub for pull requests and code, AWS for logs, Lambdas and secret names, and ServiceNow for incidents and change requests. Each one only reads, and each command says what it runs.

Video, about one minute, with narration and captions.

Before you start

Copado: where a Salesforce change is

sfe copado promotions --limit 8

The latest promotions: what moved from which org to which, and how it ended

A promotion moves user stories from one org to the next, on the way to Production. The other Copado commands: sfe copado where <ticket> finds a change by its Jira key, story shows one user story with its commits, released lists what reached Production, and pipeline draws the whole path.

GitHub: pull requests and code

sfe gh prs orc --limit 6

The latest pull requests of the ORC repository

orc is the short name the pack gives the repository; sfe gh repos lists them all. The other commands read one pull request with its files or diff, search code across every repository, list Actions runs and commits, and read a file at any branch.

A big file is read in parts. --lines takes a range, and --grep finds the lines that match, with their line numbers and two lines around each:

sfe gh file orc src/server.js --lines 200-320
sfe gh file orc src/server.js --grep "retry"

Without either, a file over about 40 KB shows its first lines and says how many lines it has, with the next --lines range to ask for. sfe gh search shows the line that matched next to each file, not only the path.

Is a change deployed?

For a team that deploys from a gitops repository, the pack can say where the values file of each service and environment is (under systems.deploy.gitops). Then sfe deployed reads the image tag of every environment, and with --pr or --ticket says whether that change is in it:

sfe deployed checkout --ticket PLAT-123

It reads the files, not the running image, and says so. With no gitops description in the pack, it prints an example to add:

"deploy": {
  "gitops": {
    "repo": "platform-gitops",
    "ref": "main",
    "path": "apps/{service}/values-{env}.yaml",
    "tagKey": "image.tag",
    "environments": { "sit": {}, "stage": {}, "prod": { "repo": "platform-gitops-prod" } },
    "services": { "checkout": { "repo": "checkout-service" } }
  }
}

AWS: Lambdas, logs, secret names

sfe aws lambdas --contains orc -e sit

The Lambda functions of the SIT lane whose name holds orc, with runtime and last change

-e sit reads the SIT lane for this one command; without it, sfe reads the lane we chose with sfe use. The rest: sfe aws whoami says which account and role a profile resolves to, accounts lists every account our sign-in reaches, logs <group> searches CloudWatch, ecs and log-groups list what runs, and secrets and params list names only, never the values. sfe use stage points AWS, and every other system, at the stage lane.

Queues and metrics have their own reads:

sfe aws queues --prefix results
sfe aws metric AWS/SQS ApproximateNumberOfMessagesVisible --dimension QueueName=results-dlq --since 6h

sfe aws queues reads every SQS queue whose name starts with the prefix in one call: messages waiting, in flight and delayed, the age of the oldest message, its dead-letter queue and how many receives send a message there, the retention, and which queues feed it. A dead-letter queue (DLQ, where failed messages are parked) that holds messages is listed first. It never receives or removes a message. sfe aws metric reads one CloudWatch metric as a small table of time and value; --stat picks Average, Sum, Maximum, Minimum or SampleCount, and --period the seconds per point.

ServiceNow: incidents and change requests

sfe snow get CHG0052051

One change request: its state, its window, its group and its description

sfe snow get reads any ticket by number: an incident, a major incident, a request, a task, a change, a problem or a knowledge article. notes reads its comments and work notes, search finds tickets by words (each word on its own, and --group ours keeps to the team's group), mi lists the major incidents, and mine lists the open tickets assigned to us.

A pack made with sfe start knows the standard tables (incidents, requests, tasks, changes, problems, knowledge). Major incidents often live in a table of the instance's own, such as u_major_incident; sfe start asks for it, and the pack keeps it as "tables": { "MI": "u_major_incident" } under systems.servicenow.

And a bare value

We can also type just a value. sfe works out what it is and looks it up in the right system:

sfe MI0007755          # a ServiceNow ticket
sfe ENG27-6254         # a Jira ticket, and where its change is
sfe US-0032392         # a Copado user story