• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

facebookincubator / TTPForge
64%
main: 67%

Build:
Build:
LAST BUILD BRANCH: export-D82462428
DEFAULT BRANCH: main
Repo Added 14 Aug 2023 10:15AM UTC
Token Ra8RGMp9erWTTLNu6nJqTb1aoVijgYIX7 regen
Build 414 Last
Files 69
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

LAST BUILD ON BRANCH export-D61387125
branch: export-D61387125
CHANGE BRANCH
x
Reset
Sync Branches
  • export-D61387125
  • container
  • container-fix
  • coverage
  • dep-lock
  • dependabot/go_modules/golang.org/x/crypto-0.35.0
  • doc-pc
  • expect
  • expected-step-failure
  • export-D50618372
  • export-D50635423
  • export-D50708311
  • export-D50892103
  • export-D50990440
  • export-D51069461
  • export-D51070150
  • export-D51139869
  • export-D51171741
  • export-D51180590
  • export-D51306975
  • export-D51307671
  • export-D51407546
  • export-D51428503
  • export-D51434166
  • export-D51434373
  • export-D51435517
  • export-D51437115
  • export-D51439700
  • export-D51449622
  • export-D51449668
  • export-D51451469
  • export-D51457037
  • export-D51458305
  • export-D51459133
  • export-D51459399
  • export-D51459508
  • export-D51459753
  • export-D51467408
  • export-D51475492
  • export-D51482864
  • export-D51495585
  • export-D51498587
  • export-D51520144
  • export-D51520434
  • export-D59696048
  • export-D59864499
  • export-D60238880
  • export-D60419102
  • export-D60423533
  • export-D60686691
  • export-D61042469
  • export-D61657101
  • export-D61658174
  • export-D61662534
  • export-D62530409
  • export-D63457210
  • export-D63702296
  • export-D64108097
  • export-D65080213
  • export-D65831540
  • export-D66702400
  • export-D68783463
  • export-D69546940
  • export-D69863376
  • export-D69953549
  • export-D70136417
  • export-D70192169
  • export-D70499233
  • export-D71635625
  • export-D71739496
  • export-D71841703
  • export-D72669013
  • export-D72670580
  • export-D73053704
  • export-D76082173
  • export-D77463007
  • export-D77619765
  • export-D78497399
  • export-D78521586
  • export-D78701235
  • export-D78753717
  • export-D78761882
  • export-D79202811
  • export-D79562207
  • export-D80822110
  • export-D80826527
  • export-D81613044
  • export-D82462426
  • export-D82462427
  • export-D82462428
  • fix-no-cleanup
  • fixup-T168084774-main
  • forge-integration-tests
  • magefile-updates
  • main
  • mitre-yaml
  • os-and-arch-metadata
  • pt-code-owners
  • renovate/actions-checkout-3.x
  • renovate/actions-checkout-4.x
  • renovate/actions-checkout-digest
  • renovate/actions-setup-python-digest
  • renovate/codespell-project-codespell-2.x
  • renovate/docker-build-push-action-5.x
  • renovate/docker-build-push-action-digest
  • renovate/docker-login-action-3.x
  • renovate/docker-setup-buildx-action-3.x
  • renovate/docker-setup-buildx-action-digest
  • renovate/docker-setup-qemu-action-3.x
  • renovate/github-codeql-action-digest
  • renovate/github.com-l50-goutils-v2-2.x
  • renovate/github.com-spf13-afero-1.x
  • renovate/github.com-tidwall-gjson-1.x
  • renovate/go.uber.org-zap-1.x
  • renovate/golang-1.x
  • renovate/goreleaser-goreleaser-action-5.x
  • renovate/goreleaser-goreleaser-action-digest
  • renovate/pin-dependencies
  • renovate/pre-commit-pre-commit-hooks-4.x
  • renovate/python-3.x
  • renovate/renovatebot-github-action-39.x
  • renovate/returntocorp-semgrep-action-digest
  • renovate/shogo82148-actions-goveralls-digest
  • sfm-create-file-new
  • sfm-create-file-step
  • sfm-downgrade-afero
  • sfm-downgrade-zap
  • sfm-dry-run
  • sfm-edit-and-create-refactor
  • sfm-fix-asdf
  • sfm-fix-indirects
  • sfm-fix-logs-and-remove-viper
  • sfm-fix-template-bug
  • sfm-fix-token
  • sfm-fix-usage
  • sfm-fix-working-directory-handling
  • sfm-install-command
  • sfm-reduce-minimum-go-version
  • sfm-remove-codeowner
  • sfm-remove-json-string
  • sfm-tmp-remove-vscode
  • sfm-update-files-package
  • sfm-update-gjson
  • sfm-update-zap
  • sfm-use-latest-release
  • test
  • test-refactor

21 Aug 2024 06:59PM UTC coverage: 63.821%. First build
10495847045

Pull #509

github

facebook-github-bot
Properly process powershell nested scripts as TTP steps (#509)

Summary:
Pull Request resolved: https://github.com/facebookincubator/TTPForge/pull/509

## Problem scope
Let's test with the following simple powershell script
```
% cat nested.ps
echo "start"
if ($true) {
  echo "nested"
}
echo "stop"
```

Here is results of running this script differently
```
% pwsh -File nested.ps
start
nested
stop
% pwsh nested.ps
start
nested
stop
% cat nested.ps | pwsh -File -
PS /data/users/nesusvet/fbsource/fbcode> echo "start"
start
PS /data/users/nesusvet/fbsource/fbcode> if ($true) {
>>   echo "nested"
>> }
>> echo "stop"
>> %
% cat nested.ps | pwsh -Command -
start
```

## Initial proposal
Instead of writing the TTP step body to power shell process stdin, we might rely on a new temp file to hold the body of TTP step to pass it to PowerShell as only argument.  This produces the best results.

### Limitations
Runtime environment where standard golang library call to `os.CreateTemp` fails or the file created is not writable.

## Can We Do Better?

Actually **yes** when we better understand the way PowerShell processes scripts from stdin.
It is expected to wrap your commands into `&{}` block before passing it to PowerShell's stdin.
See [documentation](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_pwsh?view=powershell-7.4#-command---c) on `-Command` param for details.

Resolves https://github.com/facebookincubator/TTPForge/issues/481

Reviewed By: CrimsonK1ng

Differential Revision: D61387125
Pull Request #509: Use temp file to process powershell nested scripts as TTP steps

31 of 42 new or added lines in 2 files covered. (73.81%)

1787 of 2800 relevant lines covered (63.82%)

13.66 hits per line

Relevant lines Covered
Build:
Build:
2800 RELEVANT LINES 1787 COVERED LINES
13.66 HITS PER LINE
Source Files on export-D61387125
  • Tree
  • List 57
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
10495847045 export-D61387125 Properly process powershell nested scripts as TTP steps (#509) Summary: Pull Request resolved: https://github.com/facebookincubator/TTPForge/pull/509 ## Problem scope Let's test with the following simple powershell script ``` % cat nested.ps ech... Pull #509 21 Aug 2024 07:01PM UTC facebook-github-bot github
63.82
10486631795 export-D61387125 Properly process powershell nested scripts as TTP steps (#509) Summary: Pull Request resolved: https://github.com/facebookincubator/TTPForge/pull/509 ## Problem scope Let's test with the following simple powershell script ``` % cat nested.ps ech... Pull #509 21 Aug 2024 08:49AM UTC facebook-github-bot github
63.82
10478065406 export-D61387125 Properly process powershell nested scripts as TTP steps (#509) Summary: Pull Request resolved: https://github.com/facebookincubator/TTPForge/pull/509 ## Problem scope Let's test with the following simple powershell script ``` % cat nested.ps ech... Pull #509 20 Aug 2024 07:36PM UTC facebook-github-bot github
63.84
10475584711 export-D61387125 Properly process powershell nested scripts as TTP steps (#509) Summary: Pull Request resolved: https://github.com/facebookincubator/TTPForge/pull/509 ## Problem scope Let's test with the following simple powershell script ``` % cat nested.ps ech... Pull #509 20 Aug 2024 04:35PM UTC facebook-github-bot github
63.84
10452897637 export-D61387125 Use temp file to process powershell nested scripts as TTP steps (#509) Summary: Pull Request resolved: https://github.com/facebookincubator/TTPForge/pull/509 ## Problem scope Let's test with the following simple powershell script ``` % cat neste... Pull #509 19 Aug 2024 12:00PM UTC facebook-github-bot github
63.32
10452442178 export-D61387125 Use temp file to process powershell nested scripts as TTP steps (#509) Summary: Pull Request resolved: https://github.com/facebookincubator/TTPForge/pull/509 ## Problem scope Let's test with the following simple powershell script ``` % cat neste... Pull #509 19 Aug 2024 11:25AM UTC facebook-github-bot github
63.32
10422202615 export-D61387125 Use temp file to process powershell nested scripts as TTP steps (#509) Summary: Pull Request resolved: https://github.com/facebookincubator/TTPForge/pull/509 ## Problem scope Let's test with the following simple powershell script ``` % cat neste... Pull #509 16 Aug 2024 03:15PM UTC facebook-github-bot github
63.66
10421993985 export-D61387125 Use temp file to process powershell nested scripts as TTP steps Summary: ## Problem scope Let's test with the following simple powershell script ``` % cat nested.ps echo "start" if ($true) { echo "nested" } echo "stop" ``` Here is results of r... Pull #509 16 Aug 2024 03:01PM UTC facebook-github-bot github
63.73
See All Builds (404)
  • Settings
  • Repo on GitHub
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc