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

Adding prettier command and running it for the first time #7893

Merged
merged 1 commit into from
Oct 18, 2024

Conversation

ytimocin
Copy link
Contributor

@ytimocin ytimocin commented Sep 6, 2024

Description

Adding prettier command and running it for the first time.

Type of change

  • This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional).

Fixes: #issue_number

@ytimocin ytimocin requested review from a team as code owners September 6, 2024 21:18
@radius-functional-tests
Copy link

radius-functional-tests bot commented Sep 6, 2024

Radius functional test overview

🔍 Go to test action run

Name Value
Repository radius-project/radius
Commit ref 15cff8e
Unique ID func61175ee7a7
Image tag pr-func61175ee7a7
Click here to see the list of tools in the current test run
  • gotestsum 1.12.0
  • KinD: v0.20.0
  • Dapr: 1.12.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.3.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/testrecipes/test-bicep-recipes/<name>:pr-func61175ee7a7
  • Terraform recipe location http://tf-module-server.radius-test-tf-module-server.svc.cluster.local/<name>.zip (in cluster)
  • applications-rp test image location: ghcr.io/radius-project/dev/applications-rp:pr-func61175ee7a7
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-func61175ee7a7
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-func61175ee7a7
  • deployment-engine test image location: ghcr.io/radius-project/deployment-engine:latest

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting datastoresrp-cloud functional tests...
⌛ Starting ucp-cloud functional tests...
⌛ Starting corerp-cloud functional tests...
✅ datastoresrp-cloud functional tests succeeded
✅ ucp-cloud functional tests succeeded
✅ corerp-cloud functional tests succeeded

Copy link

github-actions bot commented Sep 6, 2024

Unit Tests

3 478 tests  ±0   3 470 ✅ ±0   5m 15s ⏱️ -2s
  270 suites ±0       8 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit 713dee3. ± Comparison against base commit 1c73038.

♻️ This comment has been updated with latest results.

build/prettier.mk Outdated Show resolved Hide resolved
@rynowak
Copy link
Contributor

rynowak commented Sep 10, 2024

Lets have a discussion before adding new required tools.

For starters, whats the benefit of adding prettier to our contribution process? Why is this worth having every contributor install it and learn how to use it?

build/prettier.mk Outdated Show resolved Hide resolved
@radius-functional-tests
Copy link

radius-functional-tests bot commented Oct 14, 2024

Radius functional test overview

🔍 Go to test action run

Name Value
Repository radius-project/radius
Commit ref 9c712f0
Unique ID func632a96e2a1
Image tag pr-func632a96e2a1
Click here to see the list of tools in the current test run
  • gotestsum 1.12.0
  • KinD: v0.20.0
  • Dapr: 1.12.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.3.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/testrecipes/test-bicep-recipes/<name>:pr-func632a96e2a1
  • Terraform recipe location http://tf-module-server.radius-test-tf-module-server.svc.cluster.local/<name>.zip (in cluster)
  • applications-rp test image location: ghcr.io/radius-project/dev/applications-rp:pr-func632a96e2a1
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-func632a96e2a1
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-func632a96e2a1
  • deployment-engine test image location: ghcr.io/radius-project/deployment-engine:latest

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting datastoresrp-cloud functional tests...
⌛ Starting corerp-cloud functional tests...
⌛ Starting ucp-cloud functional tests...
✅ datastoresrp-cloud functional tests succeeded
✅ ucp-cloud functional tests succeeded
✅ corerp-cloud functional tests succeeded

Makefile Outdated Show resolved Hide resolved
build/prettier.mk Outdated Show resolved Hide resolved

PRETTIER_VERSION := 3.3.3

prettier-check:
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add documentation for these, use the other files as an example. When it's done you should see the new targets in the command line help printed by make.


prettier-format:
@npx prettier@$(PRETTIER_VERSION) --write "*/**/*.{ts,js,mjs,json}"

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion:

Should we name/group these commands based on their purpose rather than their tool?

Example:

make format-check

VS

make prettier-check

Consider what would happen if we add more formatting tools in the future.

build/prettier.mk Outdated Show resolved Hide resolved
@npx prettier@$(PRETTIER_VERSION) --check "*/**/*.{ts,js,mjs,json}"

prettier-format:
@npx prettier@$(PRETTIER_VERSION) --write "*/**/*.{ts,js,mjs,json}"
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the experience like if node is not installed? What about when it's an ancient version of node?


```sh
make me prettier
```
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we be less clever about the name?

I think this guidance should be combined with line 14. The idea is that we're giving contributors simple advice. Saying "run make format build test lint" is simpler than saying "run make build test lint and then run make prettier".

@radius-functional-tests
Copy link

radius-functional-tests bot commented Oct 16, 2024

Radius functional test overview

🔍 Go to test action run

Name Value
Repository radius-project/radius
Commit ref ebcca56
Unique ID funcf629a26e8f
Image tag pr-funcf629a26e8f
Click here to see the list of tools in the current test run
  • gotestsum 1.12.0
  • KinD: v0.20.0
  • Dapr: 1.12.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.3.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/testrecipes/test-bicep-recipes/<name>:pr-funcf629a26e8f
  • Terraform recipe location http://tf-module-server.radius-test-tf-module-server.svc.cluster.local/<name>.zip (in cluster)
  • applications-rp test image location: ghcr.io/radius-project/dev/applications-rp:pr-funcf629a26e8f
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-funcf629a26e8f
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-funcf629a26e8f
  • deployment-engine test image location: ghcr.io/radius-project/deployment-engine:latest

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting corerp-cloud functional tests...
⌛ Starting ucp-cloud functional tests...
✅ ucp-cloud functional tests succeeded
✅ corerp-cloud functional tests succeeded

Copy link

codecov bot commented Oct 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 59.34%. Comparing base (1c73038) to head (713dee3).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7893   +/-   ##
=======================================
  Coverage   59.33%   59.34%           
=======================================
  Files         560      560           
  Lines       37488    37487    -1     
=======================================
+ Hits        22245    22247    +2     
+ Misses      13697    13695    -2     
+ Partials     1546     1545    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Also running the prettier command for the first time

Signed-off-by: ytimocin <[email protected]>
@radius-functional-tests
Copy link

radius-functional-tests bot commented Oct 17, 2024

Radius functional test overview

🔍 Go to test action run

Name Value
Repository radius-project/radius
Commit ref 713dee3
Unique ID funcdb04695a1d
Image tag pr-funcdb04695a1d
Click here to see the list of tools in the current test run
  • gotestsum 1.12.0
  • KinD: v0.20.0
  • Dapr: 1.12.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.3.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/testrecipes/test-bicep-recipes/<name>:pr-funcdb04695a1d
  • Terraform recipe location http://tf-module-server.radius-test-tf-module-server.svc.cluster.local/<name>.zip (in cluster)
  • applications-rp test image location: ghcr.io/radius-project/dev/applications-rp:pr-funcdb04695a1d
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-funcdb04695a1d
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-funcdb04695a1d
  • deployment-engine test image location: ghcr.io/radius-project/deployment-engine:latest

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting corerp-cloud functional tests...
⌛ Starting ucp-cloud functional tests...
✅ ucp-cloud functional tests succeeded
✅ corerp-cloud functional tests succeeded

if: steps.format-check.outcome == 'failure'
run: |
echo "Format check failed. Please fix the formatting issues. You can run 'make format-write' to update the code."
exit 1
Copy link
Contributor

Choose a reason for hiding this comment

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

Awesome 👍

Copy link
Contributor

@rynowak rynowak left a comment

Choose a reason for hiding this comment

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

:shipit: nice!

@ytimocin ytimocin merged commit a879fcc into main Oct 18, 2024
35 checks passed
@ytimocin ytimocin deleted the ytimocin/build/prettier branch October 18, 2024 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants