Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Make 'prettier -w .' work from the root #15759

Merged
merged 26 commits into from
Jun 7, 2023

Conversation

tylerbutler
Copy link
Member

@tylerbutler tylerbutler commented May 30, 2023

Related to #15758.

This PR adds new prettier scripts to run on the whole repo. I also updated the prettierignore files to ignore additional files. The prettier --write . command should also now work from the root of any release group.

@github-actions github-actions bot added area: build Build related issues area: server Server related issues (routerlicious) area: website base: main PRs targeted against main branch labels May 30, 2023
.prettierignore Outdated Show resolved Hide resolved
scottn12 and others added 3 commits June 2, 2023 12:37
…of unique columns in telemetry (microsoft#15827)

## Description

Precursors:
* PR microsoft#12863 moved the
typings for our internal loggers to telemetry-utils package and added
support for arrays.
* PR microsoft#15667 upgraded the client release group to use the new types

This PR updates that type further to add support for flat objects. This
has become a more common practice to consolidate event-specific
properties, e.g. in a `details` object. Today instrumentation does the
JSON.stringify itself, but this is not ideal. It's proven the utility of
logging properties like this, so this PR adds first-class support for
this.

## Breaking Changes

Yes, this is a breaking change. If a logger implements the existing
logger contracts based on the existing type, it will not necessarily be
equipped to handle a flat object.

In practice, there shouldn't be any follow-up required. These types are
only used for our internal logging contracts, which are always fulfilled
by a class derived from `TelemetryLogger`, which actually handles this
case just fine without any changes.

The API surface we expect partners to use always speaks in
`ITelemetryBaseLogger` which is unchanged here.
@microsoft microsoft deleted a comment from github-actions bot Jun 4, 2023
@github-actions github-actions bot added area: dds Issues related to distributed data structures and removed area: server Server related issues (routerlicious) labels Jun 5, 2023
@github-actions github-actions bot added area: contributor experience area: examples Changes that focus on our examples area: server Server related issues (routerlicious) labels Jun 5, 2023
@tylerbutler tylerbutler marked this pull request as ready for review June 5, 2023 17:58
@tylerbutler tylerbutler requested a review from msfluid-bot as a code owner June 5, 2023 17:58
@tylerbutler tylerbutler requested review from a team as code owners June 5, 2023 17:58
@tylerbutler tylerbutler changed the title build: Make 'prettier -w .' work build: Make 'prettier -w .' work from the root Jun 5, 2023
@msfluid-bot
Copy link
Collaborator

msfluid-bot commented Jun 5, 2023

Baseline CI build failed, cannot generate bundle analysis at this time


Baseline commit: dfd899b

Generated by 🚫 dangerJS against 3784ee6

experimental/dds/tree-graphql/package.json Show resolved Hide resolved
package.json Outdated
Comment on lines 61 to 62
"prettier": "prettier --check . --ignore-path ./.prettierignore",
"prettier:fix": "prettier --write . --ignore-path ./.prettierignore",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will this start formatting the server release group when run from the root, right? Is that intended? I think it shouldn't...

Copy link
Member Author

@tylerbutler tylerbutler Jun 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's intended. In the ideal case, this should never be a problem because CI enforces that everything is formatted properly already, so it shouldn't matter.

If we don't do it this way, where should the script to format the whole repo live?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think my honest answer to that is "here but server should live in a separate repo" 😆. Not strongly opposed to moving forward like this, just noting that my spidey sense reacted. One specific concern I have is if server folks update "their copy" of .prettierignore but no the root; we expect CI to fail in that case because it will format from the root and cause the validation for unexpected file changes to complain?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created new prettier:repo and format:repo scripts so the old ones still stay scoped to the client release group.

Copy link
Contributor

@alexvy86 alexvy86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR description maybe needs an update, but the change LGTM.

@tylerbutler tylerbutler requested a review from a team as a code owner June 6, 2023 17:55
@github-actions github-actions bot added the public api change Changes to a public API label Jun 6, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jun 7, 2023

🔗 Found some broken links! 💔

Run a link check locally to find them. See
https://github.com/microsoft/FluidFramework/wiki/Checking-for-broken-links-in-the-documentation for more information.

linkcheck output


> fluidframework-docs@0.25.0 ci:linkcheck /home/runner/work/FluidFramework/FluidFramework/docs
> start-server-and-test ci:start http://localhost:1313 linkcheck:full

1: starting server using command "npm run ci:start"
and when url "[ 'http://localhost:1313' ]" is responding with HTTP status code 200
running tests using command "npm run linkcheck:full"


> fluidframework-docs@0.25.0 ci:start
> http-server ./public --port 1313 --silent


> fluidframework-docs@0.25.0 linkcheck:full
> npm run linkcheck:fast -- --external


> fluidframework-docs@0.25.0 linkcheck:fast
> linkcheck http://localhost:1313 --skip-file skipped-urls.txt --external

Crawling...

http://localhost:1313/docs/apis/
- (988:8) '@fluid-i..' => http://localhost:1313/docs/apis/app-insights-logger (HTTP 404)

http://localhost:1313/docs/apis/runtime-definitions/
- (1818:37) 'https://..' => https://datatracker.ietf.org/doc/html/rfc4122%29 (HTTP 404)
- (1818:37) 'https://..' => https://datatracker.ietf.org/doc/html/rfc4122%29 (HTTP 404)


Stats:
  209773 links
    2022 destination URLs
       2 URLs ignored
       0 warnings
       2 errors

 ELIFECYCLE  Command failed with exit code 1.

@tylerbutler tylerbutler merged commit 8ae4fe3 into microsoft:main Jun 7, 2023
@tylerbutler tylerbutler deleted the docs-prettier branch June 7, 2023 00:50
connorskees pushed a commit to connorskees/FluidFramework that referenced this pull request Jul 19, 2023
Related to microsoft#15758.

This PR adds new prettier scripts to run on the whole repo. I also
updated the prettierignore files to ignore additional files. The
`prettier --write .` command should also now work from the root of any
release group.

---------

Co-authored-by: Scott Norton <scottnorton@microsoft.com>
Co-authored-by: Mark Fields <markfields@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: build Build related issues area: contributor experience area: dds Issues related to distributed data structures area: examples Changes that focus on our examples area: server Server related issues (routerlicious) area: website base: main PRs targeted against main branch public api change Changes to a public API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants