Skip to content

Commit

Permalink
Merge branch 'main' into shellcheck
Browse files Browse the repository at this point in the history
Signed-off-by: Brooke Hamilton <[email protected]>
  • Loading branch information
brooke-hamilton committed Oct 24, 2024
2 parents 7278347 + dd86d60 commit f5cb333
Show file tree
Hide file tree
Showing 872 changed files with 24,051 additions and 21,285 deletions.
96 changes: 48 additions & 48 deletions .devcontainer/contributor/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
{
"name": "Radius - Contributor",
// For details see https://github.com/radius-project/radius/tree/main/docs/contributing/contributing-code/contributing-code-prerequisites
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
//Git and GitHub Setup
"ghcr.io/devcontainers/features/git:1": {},
"ghcr.io/devcontainers/features/github-cli:1": {},
//Programming languages
"ghcr.io/devcontainers/features/go:1": {},
"ghcr.io/guiyomh/features/gotestsum:0.1.1": {},
"ghcr.io/devcontainers/features/node:1": {},
"ghcr.io/devcontainers-contrib/features/typescript:2": {},
"ghcr.io/devcontainers/features/python:1": {},
//Container and K8s
"ghcr.io/devcontainers/features/kubectl-helm-minikube:1": {
"minikube": "none"
},
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"version": "latest",
"moby": true
},
//Tools
"ghcr.io/eitsupi/devcontainer-features/jq-likes:2": {},
"ghcr.io/mpriscella/features/kind:1": {},
"ghcr.io/dhoeric/features/stern:1": {},
//Dapr
"ghcr.io/dapr/cli/dapr-cli:0": {}
"name": "Radius - Contributor",
// For details see https://github.com/radius-project/radius/tree/main/docs/contributing/contributing-code/contributing-code-prerequisites
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
//Git and GitHub Setup
"ghcr.io/devcontainers/features/git:1": {},
"ghcr.io/devcontainers/features/github-cli:1": {},
//Programming languages
"ghcr.io/devcontainers/features/go:1": {},
"ghcr.io/guiyomh/features/gotestsum:0.1.1": {},
"ghcr.io/devcontainers/features/node:1": {},
"ghcr.io/devcontainers-contrib/features/typescript:2": {},
"ghcr.io/devcontainers/features/python:1": {},
//Container and K8s
"ghcr.io/devcontainers/features/kubectl-helm-minikube:1": {
"minikube": "none"
},
"customizations": {
"vscode": {
"extensions": [
"redhat.vscode-yaml",
"golang.go",
"ms-python.python",
"ms-python.vscode-pylance",
"ms-azuretools.vscode-bicep",
"ms-kubernetes-tools.vscode-kubernetes-tools",
"ms-azuretools.vscode-dapr",
"ms-vscode.makefile-tools",
"timonwong.shellcheck"
]
}
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"version": "latest",
"moby": true
},
// Prerequisite for Code Generation, see https://github.com/radius-project/radius/tree/main/docs/contributing/contributing-code/contributing-code-prerequisites#code-generation
// Adding workspace as safe directory to avoid permission issues
"postCreateCommand": "git config --global --add safe.directory /workspaces/radius && cd typespec && npm ci && npm install -g autorest && npm install -g oav && go install sigs.k8s.io/controller-tools/cmd/[email protected] && go install go.uber.org/mock/[email protected]",
"hostRequirements": {
"memory": "8gb"
},
}
//Tools
"ghcr.io/eitsupi/devcontainer-features/jq-likes:2": {},
"ghcr.io/mpriscella/features/kind:1": {},
"ghcr.io/dhoeric/features/stern:1": {},
//Dapr
"ghcr.io/dapr/cli/dapr-cli:0": {}
},
"customizations": {
"vscode": {
"extensions": [
"redhat.vscode-yaml",
"golang.go",
"ms-python.python",
"ms-python.vscode-pylance",
"ms-azuretools.vscode-bicep",
"ms-kubernetes-tools.vscode-kubernetes-tools",
"ms-azuretools.vscode-dapr",
"ms-vscode.makefile-tools",
"timonwong.shellcheck"
]
}
},
// Prerequisite for Code Generation, see https://github.com/radius-project/radius/tree/main/docs/contributing/contributing-code/contributing-code-prerequisites#code-generation
// Adding workspace as safe directory to avoid permission issues
"postCreateCommand": "git config --global --add safe.directory /workspaces/radius && cd typespec && npm ci && npm install -g autorest && npm install -g oav && go install sigs.k8s.io/controller-tools/cmd/[email protected] && go install go.uber.org/mock/[email protected]",
"hostRequirements": {
"memory": "8gb"
}
}
8 changes: 4 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@ updates:
groups:
all:
patterns:
- "*"
- "*"
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "weekly"
groups:
all:
patterns:
- "*"
- "*"
- package-ecosystem: "devcontainers"
directory: "/.devcontainer"
directory: "/.devcontainer/contributor"
schedule:
interval: weekly
groups:
all:
patterns:
- "*"
- "*"
- package-ecosystem: "gitsubmodule"
directory: "/"
schedule:
Expand Down
10 changes: 10 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,13 @@ Please update the following to link the associated issue. This is required for s
-->

Fixes: #issue_number

## Contributor checklist
Please verify that the PR meets the following requirements, where applicable:

- [ ] An overview of proposed schema changes is included in a linked GitHub issue.
- [ ] A design document PR is created in the [design-notes repository](https://github.com/radius-project/design-notes/), if new APIs are being introduced.
- [ ] If applicable, design document has been reviewed and approved by Radius maintainers/approvers.
- [ ] A PR for the [samples repository](https://github.com/radius-project/samples) is created, if existing samples are affected by the changes in this PR.
- [ ] A PR for the [documentation repository](https://github.com/radius-project/docs) is created, if the changes in this PR affect the documentation or any user facing updates are made.
- [ ] A PR for the [recipes repository](https://github.com/radius-project/recipes) is created, if existing recipes are affected by the changes in this PR.
87 changes: 48 additions & 39 deletions .github/scripts/radius-bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,39 +15,44 @@ limitations under the License.
*/

module.exports = async ({ github, context }) => {
if (context.eventName === 'issue_comment' && context.payload.action === 'created') {
try {
await handleIssueCommentCreate({ github, context });
} catch (error) {
console.log(`[handleIssueCommentCreate] unexpected error: ${error}`);
}
if (
context.eventName === "issue_comment" &&
context.payload.action === "created"
) {
try {
await handleIssueCommentCreate({ github, context });
} catch (error) {
console.log(`[handleIssueCommentCreate] unexpected error: ${error}`);
}
}
}
};

// Handle issue comment create event.
async function handleIssueCommentCreate({ github, context }) {
const payload = context.payload;
const issue = context.issue;
const isFromPulls = !!payload.issue.pull_request;
const commentBody = payload.comment.body;
const username = context.actor;
const payload = context.payload;
const issue = context.issue;
const isFromPulls = !!payload.issue.pull_request;
const commentBody = payload.comment.body;
const username = context.actor;

if (!commentBody) {
console.log('[handleIssueCommentCreate] comment body not found, exiting.');
return;
}
if (!commentBody) {
console.log("[handleIssueCommentCreate] comment body not found, exiting.");
return;
}

const commandParts = commentBody.split(/\s+/);
const command = commandParts.shift();
const commandParts = commentBody.split(/\s+/);
const command = commandParts.shift();

switch (command) {
case '/assign':
await cmdAssign(github, issue, isFromPulls, username);
break;
default:
console.log(`[handleIssueCommentCreate] command ${command} not found, exiting.`);
break;
}
switch (command) {
case "/assign":
await cmdAssign(github, issue, isFromPulls, username);
break;
default:
console.log(
`[handleIssueCommentCreate] command ${command} not found, exiting.`,
);
break;
}
}

/**
Expand All @@ -58,18 +63,22 @@ async function handleIssueCommentCreate({ github, context }) {
* @param {*} username is the user who trigger the command
*/
async function cmdAssign(github, issue, isFromPulls, username) {
if (isFromPulls) {
console.log('[cmdAssign] pull requests not supported, skipping command execution.');
return;
} else if (issue.assignees && issue.assignees.length !== 0) {
console.log('[cmdAssign] issue already has assignees, skipping command execution.');
return;
}
if (isFromPulls) {
console.log(
"[cmdAssign] pull requests not supported, skipping command execution.",
);
return;
} else if (issue.assignees && issue.assignees.length !== 0) {
console.log(
"[cmdAssign] issue already has assignees, skipping command execution.",
);
return;
}

await github.rest.issues.addAssignees({
owner: issue.owner,
repo: issue.repo,
issue_number: issue.number,
assignees: [username],
});
await github.rest.issues.addAssignees({
owner: issue.owner,
repo: issue.repo,
issue_number: issue.number,
assignees: [username],
});
}
11 changes: 3 additions & 8 deletions .github/workflows/functional-test-cloud.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ jobs:
# https://github.com/radius-project/radius/issues/7782
if [[ "${{ github.event_name }}" == "workflow_run" ]]; then
echo "Triggered by workflow_run."
echo "Head Ref: ${{ github.head_ref }}"
echo "Ref: ${{ github.ref }}"
echo "Head Branch Name: ${{ github.event.workflow_run.head_branch }}"
echo "SHA Value: ${{ github.event.workflow_run.head_sha }}"
Expand Down Expand Up @@ -393,9 +392,7 @@ jobs:
cat <<EOF > ./test/bicepconfig.json
{
"experimentalFeaturesEnabled": {
"extensibility": true,
"extensionRegistry": true,
"dynamicTypeLoading": true
"extensibility": true
},
"extensions": {
"radius": "br:${{ env.BICEP_TYPES_REGISTRY }}/test/radius:$RADIUS_VERSION",
Expand Down Expand Up @@ -451,7 +448,7 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-latest-m]
name: [corerp-cloud, ucp-cloud, datastoresrp-cloud]
name: [corerp-cloud, ucp-cloud]
runs-on: ${{ matrix.os }}
env:
UNIQUE_ID: ${{ needs.build.outputs.UNIQUE_ID }}
Expand Down Expand Up @@ -697,9 +694,7 @@ jobs:
cat <<EOF > ./test/bicepconfig.json
{
"experimentalFeaturesEnabled": {
"extensibility": true,
"extensionRegistry": true,
"dynamicTypeLoading": true
"extensibility": true
},
"extensions": {
"radius": "br:${{ env.BICEP_TYPES_REGISTRY }}/test/radius:$RADIUS_VERSION",
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/functional-test-noncloud.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,7 @@ jobs:
cat <<EOF > ./test/bicepconfig.json
{
"experimentalFeaturesEnabled": {
"extensibility": true,
"extensionRegistry": true,
"dynamicTypeLoading": true
"extensibility": true
},
"extensions": {
"radius": "br:${{ env.LOCAL_REGISTRY_SERVER }}:${{ env.LOCAL_REGISTRY_PORT }}/radius:$RADIUS_VERSION",
Expand Down
24 changes: 22 additions & 2 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: "18"
node-version: "22"
- name: Install TypeSpec compiler
run: |
pushd typespec
Expand All @@ -59,7 +59,7 @@ jobs:
- name: Install mockgen
run: go install go.uber.org/mock/[email protected]
- name: Install controller-gen
run: go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.15.0
run: go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.16.0
- name: Install helm
uses: azure/setup-helm@v4
with:
Expand Down Expand Up @@ -91,3 +91,23 @@ jobs:
run: |
echo "Generated code is not up to date, run 'make generate' to update generated code."
exit 1
format-check:
name: Format check with Prettier
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: "22"
- name: Run `make format-check`
id: format-check
run: |
make format-check
- name: Check for formatting failures
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
2 changes: 1 addition & 1 deletion .github/workflows/publish-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
- name: Install controller-gen
run: |
cd radius
go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.15.0
go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.16.0
# Generate Bicep docs
- name: Generate Bicep docs
run: |
Expand Down
8 changes: 8 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# .prettierignore
pkg/validator/testdata/put-environments-invalid-json.json

hack/bicep-types-radius/generated/*

bicep-types/*

swagger/*
2 changes: 2 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# These owners are the maintainers and approvers of this repo
* @radius-project/maintainers-radius @radius-project/approvers-radius
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Contributing

Radius is in an early phase of development right now. We welcome feedback in the form of issues that comes from usage and is aligned with the current scope and goals of the project.
Radius is in an early phase of development right now. We welcome feedback in the form of issues that comes from usage and is aligned with the current scope and goals of the project.

## Table of contents

You can find our full **contributor documentation** including instructions at the following links:

- [How to contribute](./docs/contributing/how-to.md)
- [See "good first issues"](https://github.com/radius-project/radius/issues?q=is:issue+is:open+label:%22good+first+issue%22)
- [See "good first issues"](https://github.com/radius-project/radius/issues?q=is:issue+is:open+label:%22good+first+issue%22)
- [Install prerequisites](./docs/contributing/contributing-code/contributing-code-prerequisites/)
- [Create your first commit (full walkthrough)](./docs/contributing/contributing-code/contributing-code-first-commit/)
- [Building the repo](./docs/contributing/contributing-code/contributing-code-building/)
Expand All @@ -21,7 +21,7 @@ You can find our full **contributor documentation** including instructions at th

We welcome small pull request contributions from anyone (docs improvements, bug fixes, minor features.) as long as they follow a few guidelines:

- For very minor changes like correcting a typo feel free to send a pull request. Otherwise ...
- For very minor changes like correcting a typo feel free to send a pull request. Otherwise ...
- Please start by [choosing an existing issue](https://github.com/radius-project/radius/issues), or [opening an issue](https://github.com/radius-project/radius/issues/new/choose) to work on.
- The maintainers will respond to your issue, please work with the maintainers to ensure that what you're doing is in scope for the project before writing any code.
- If you have any doubt whether a contribution would be valuable, feel free to ask.
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
ARROW := \033[34;1m=>\033[0m

# order matters for these
include build/help.mk build/version.mk build/build.mk build/util.mk build/generate.mk build/test.mk build/docker.mk build/recipes.mk build/install.mk build/debug.mk
include build/help.mk build/version.mk build/build.mk build/util.mk build/generate.mk build/test.mk build/docker.mk build/recipes.mk build/install.mk build/db.mk build/prettier.mk build/debug.mk
Loading

0 comments on commit f5cb333

Please sign in to comment.