Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Conversation

@burmudar
Copy link
Contributor

@burmudar burmudar commented Nov 14, 2022

Lint formatting failures have been sneaking into main and it's due to a special case in a PR when the formatting check was not applied.

When format lint is applied

In the primary lint action, the formatting lint is always added unless you specify --no-format-check.
The primary lint action is executed when:

  • When you specify no lint targets
  • Specify more than one lint target

When format lint is NOT applied

The sg lint command as a special case in its Before, where it checks how many targets there are, then deciding whether the primary action should handle the targets (targets > 1) or if it is a single target, let the subcommand action handle it.
The subcommand action didn't add the formatting lint, so if your PR diff only touched one "category" like Client, then the formatting lint will not run as in this PR run.

Test plan

  1. sg lint
go run ./dev/sg lint
👉 Running checks from targets: urls, go, docs, dockerfiles, client, svg, shell, format
│
├── 1. urls         Done!                                                                                                                                                                                                      3s
├── 2. go           Running checks...                                                                                                                                                                                          5s
├── 3. docs         Running checks...                                                                                                                                                                                          5s
├── 4. dockerfiles  Running checks...                                                                                                                                                                                          5s
├── 5. client       Running checks...                                                                                                                                                                                          5s
├── 6. svg          Category skipped: disabled: reported as unreliable                                                                                                                                                         0s
├── 7. shell        Running checks...                                                                                                                                                                                          5s
└── 8. format       Running checks... 
  1. sg lint client
go run ./dev/sg lint client
👉 Running checks from target: client

│
├── 1. client  Running checks...                                                                                                                                                                                               2s
└── 2. format  Running checks... 
  1. sg lint client docs
go run ./dev/sg lint client docs
👉 Running checks from targets: client, docs, format
│
├── 1. client  Done!                                                                                                                                                                                                           7s
├── 2. docs    Done!                                                                                                                                                                                                          26s
└── 3. format  Running checks... 
  1. sg lint --no-format-check
go run ./dev/sg lint --no-format-check
👉 Running checks from targets: urls, go, docs, dockerfiles, client, svg, shell
⠋  Running checks  
│
├── 1. urls         Running checks...                                                                                                                                                                                          2s
├── 2. go           Running checks...                                                                                                                                                                                          2s
├── 3. docs         Running checks...                                                                                                                                                                                          2s
├── 4. dockerfiles  Running checks...                                                                                                                                                                                          2s
├── 5. client       Running checks...                                                                                                                                                                                          2s
├── 6. svg          Category skipped: disabled: reported as unreliable                                                                                                                                                         0s
└── 7. shell        Running checks...
  1. sg lint --no-format-check client
go run ./dev/sg lint --no-format-check client
👉 Running checks from target: client
✅ 1. client (3s)

👌 Everything looks good! Happy hacking!

You can also see it now picks up a format error that sneaked into main on https://buildkite.com/sourcegraph/sourcegraph/builds/183251

App preview:

Check out the client app preview documentation to learn more.

@cla-bot cla-bot bot added the cla-signed label Nov 14, 2022
@sg-e2e-regression-test-bob
Copy link

sg-e2e-regression-test-bob commented Nov 14, 2022

Bundle size report 📦

Initial size Total size Async size Modules
0.00% (0.00 kb) 0.00% (0.00 kb) 0.00% (0.00 kb) 0.00% (0)

Look at the Statoscope report for a full comparison between the commits 8ce7642 and 3960596 or learn more.

Open explanation
  • Initial size is the size of the initial bundle (the one that is loaded when you open the page)
  • Total size is the size of the initial bundle + all the async loaded chunks
  • Async size is the size of all the async loaded chunks
  • Modules is the number of modules in the initial bundle

@burmudar burmudar requested review from a team and pjlast November 14, 2022 11:16
@burmudar burmudar marked this pull request as draft November 14, 2022 11:16
@sourcegraph-bot
Copy link
Contributor

sourcegraph-bot commented Nov 14, 2022

Codenotify: Notifying subscribers in OWNERS files for diff 8e28bde...8ce7642.

Notify File(s)
@mrnugget dev/sg/linters/linters.go
dev/sg/sg_lint.go
@sourcegraph/dev-experience dev/sg/linters/linters.go
dev/sg/sg_lint.go
enterprise/dev/ci/internal/ci/operations.go

@burmudar burmudar marked this pull request as ready for review November 14, 2022 11:46
@burmudar burmudar marked this pull request as draft November 14, 2022 11:50
@burmudar burmudar marked this pull request as ready for review November 14, 2022 12:33
@burmudar burmudar changed the title ci/prettier: update prettier and fix yarn script ci/prettier: update prettier, and fix single target lint Nov 14, 2022
@sourcegraph-bot
Copy link
Contributor

sourcegraph-bot commented Nov 14, 2022

Codenotify: Notifying subscribers in CODENOTIFY files for diff 8e28bde...8ce7642.

Notify File(s)
@bobheadxi enterprise/dev/ci/internal/ci/operations.go
@fkling client/web/src/search/home/SearchPage.tsx
@limitedmage client/web/src/search/home/SearchPage.tsx

@burmudar burmudar merged commit 443a720 into main Nov 14, 2022
@burmudar burmudar deleted the wb/prettier-check branch November 14, 2022 14:46
@burmudar burmudar self-assigned this Nov 14, 2022
@pjlast
Copy link
Contributor

pjlast commented Nov 15, 2022

<3 Thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants