Skip to content

Commit

Permalink
Merge branch 'main' into vishwahiremat/extend-secretstore-scope
Browse files Browse the repository at this point in the history
Signed-off-by: Vishwanath Hiremath <[email protected]>
  • Loading branch information
vishwahiremat committed Feb 15, 2024
2 parents b0023e5 + 647c0c7 commit 3813e86
Show file tree
Hide file tree
Showing 23 changed files with 328 additions and 46 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/close-stale-prs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This workflow warns and then closes PRs that have had no activity for 90 days.
#
# For more information, see:
# https://github.com/actions/stale
name: Close stale pull requests

on:
schedule:
- cron: '0 18 * * *' # Run the workflow every day at 6PM UTC (10AM PST).

jobs:
stale:

runs-on: ubuntu-latest
permissions:
pull-requests: write

steps:
- uses: actions/stale@v5
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-pr-message: 'This pull request has been automatically marked as stale because it has been inactive for 90 days. Remove stale label or comment or this PR will be closed in 7 days.'
stale-pr-label: 'stale'
days-before-pr-stale: 90 # 3 months
days-before-pr-close: 7
days-before-issue-stale: -1
days-before-issue-close: -1
22 changes: 14 additions & 8 deletions .github/workflows/long-running-azure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ on:
branches:
- main
paths:
- '.github/workflows/long-running-azure.yaml'
- ".github/workflows/long-running-azure.yaml"

env:
# Go version
GOVER: '^1.21'
GOVER: "^1.21"
GOPROXY: https://proxy.golang.org

# gotestsum version - see: https://github.com/gotestyourself/gotestsum
Expand All @@ -70,24 +70,24 @@ env:
# The region for AWS resources
AWS_REGION: us-west-2
# The AWS account ID
AWS_ACCOUNT_ID: '${{ secrets.FUNCTEST_AWS_ACCOUNT_ID }}'
AWS_ACCOUNT_ID: "${{ secrets.FUNCTEST_AWS_ACCOUNT_ID }}"

# The valid radius build time window in seconds to rebuild radius. 24 hours = 24 * 60 * 60 = 86400
VALID_RADIUS_BUILD_WINDOW: 86400

# The AKS cluster name
AKS_CLUSTER_NAME: 'radiuse2e00-aks'
AKS_CLUSTER_NAME: "radiuse2e00-aks"
# The resource group for AKS_CLUSTER_NAME resource.
AKS_RESOURCE_GROUP: 'radiuse2e00'
AKS_RESOURCE_GROUP: "radiuse2e00"

# Server where terraform test modules are deployed
TF_RECIPE_MODULE_SERVER_URL: 'http://tf-module-server.radius-test-tf-module-server.svc.cluster.local'
TF_RECIPE_MODULE_SERVER_URL: "http://tf-module-server.radius-test-tf-module-server.svc.cluster.local"

# Radius test environment name
RADIUS_TEST_ENVIRONMENT_NAME: 'kind-radius'
RADIUS_TEST_ENVIRONMENT_NAME: "kind-radius"

# The current GitHub action link
ACTION_LINK: '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'
ACTION_LINK: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"

jobs:
build:
Expand Down Expand Up @@ -333,6 +333,12 @@ jobs:
uses: azure/login@v1
with:
creds: '{"clientId":"${{ secrets.INTEGRATION_TEST_SP_APP_ID }}","clientSecret":"${{ secrets.INTEGRATION_TEST_SP_PASSWORD }}","subscriptionId":"${{ secrets.INTEGRATION_TEST_SUBSCRIPTION_ID }}","tenantId":"${{ secrets.INTEGRATION_TEST_TENANT_ID }}"}'
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create azure resource group - ${{ env.AZURE_TEST_RESOURCE_GROUP }}
run: |
current_time=$(date +%s)
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ on:
push:
branches:
- main
- 'release/*'
paths:
- 'versions.yaml'
pull_request:
Expand Down
6 changes: 5 additions & 1 deletion docs/contributing/contributing-pull-requests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,8 @@ If you are the code reviewer, it's your responsibility to follow up (politely) i

We welcome **any contributor or community member** to engage with **any pull request** on our repository. Feel free to make suggestions for improvements and ask questions that are relevant. If you're asking questions for your learning, please make it clear that your questions are "non-blocking" for the pull request.

See the [code reviewing documentation](../contributing-code/contributing-code-reviewing/README.md) for guidance on code reviewing.
See the [code reviewing documentation](../contributing-code/contributing-code-reviewing/README.md) for guidance on code reviewing.

## Inactive Pull Requests

Pull requests that have been inactive for 90 days will be marked with a stale label. They will automatically be closed after a subsequent 7 days of inactivity. This timeframe may be adjusted in the future based on project needs.
87 changes: 87 additions & 0 deletions docs/release-notes/v0.30.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
## Announcing Radius v0.30.0

Today we're happy to announce the release of Radius v0.30.0. Check out the [highlights](#highlights) below, along with the [full changelog](#full-changelog) for more details.

We would like to extend our thanks to all the [new](#new-contributors) and existing contributors who helped make this release possible!

## Intro to Radius

If you're new to Radius, check out our website, [radapp.io](https://radapp.io), for more information. Also visit our [getting started guide](https://docs.radapp.io/getting-started/) to learn how to install Radius and create your first app.

## Highlights

### Terraform Recipe enhancements

We’ve added a bunch of new supported features and scenarios for Terraform Recipes, including sub-module support, Git module source support, and version ranges. We’re actively working on additional features such as private modules and any provider. Stay tuned for updates! Learn more in [our docs](https://docs.radapp.io/guides/recipes/overview/).

### Radius roadmap

The Radius roadmap is now published at https://aka.ms/radius-roadmap, where you can keep track of all the major features and improvements we are tracking. Check it out and make sure to upvote and leave feedback on your favorites!

### Introducing the Radius dashboard

We’re excited to share a first look at a new experimental feature of Radius: the Radius dashboard! Our new dashboard allows you to interact with Radius environments, applications, and recipes from an easy-to-use graphical interface. Visit the [dashboard repo](https://github.com/radius-project/dashboard) to try it out today.

## Breaking changes

None

## New contributors

Welcome to our new contributors who have merged their first PR in this release!

* @IvanJosipovic made their first contribution in https://github.com/radius-project/radius/pull/6996
* @gpltaylor made their first contribution in https://github.com/radius-project/radius/pull/6974
* @akshayrohilla made their first contribution in https://github.com/radius-project/radius/pull/7083

## Upgrading to Radius v0.30.0

During our preview stage, an upgrade to Radius v0.30.0 requires a full reinstallation of the Radius control-plane, rad CLI, and all Radius apps. Stay tuned for an in-place upgrade path in the future.

1. Delete any environments you have created:
```bash
rad env delete <env-name>
```
1. Uninstall the previous version of the Radius control-plane:
```bash
rad uninstall kubernetes
```
1. Visit the [Radius installation guide](https://docs.radapp.io/getting-started/install/) to install the latest CLI, or download a binary below
1. Install the latest version of the Radius control-plane:
```bash
rad install kubernetes
```

## Full changelog

* Remove copilot4prs by @sk593 in https://github.com/radius-project/radius/pull/6988
* Create 0.29.0 release by @nithyatsu in https://github.com/radius-project/radius/pull/6992
* fix: remove duplicate securityContext by @IvanJosipovic in https://github.com/radius-project/radius/pull/6996
* Get long-haul test cluster working by @ytimocin in https://github.com/radius-project/radius/pull/6936
* [Add] Adding ignore-not-found to the deletion of certificate in long haul test workflow by @ytimocin in https://github.com/radius-project/radius/pull/6999
* Improve error message under 401 condition with Azure ACR by @gpltaylor in https://github.com/radius-project/radius/pull/6974
* Remove skipped test by @kachawla in https://github.com/radius-project/radius/pull/6998
* Restore AWS S3 tests by @willdavsmith in https://github.com/radius-project/radius/pull/6993
* Enable CLI container port expose test by @youngbupark in https://github.com/radius-project/radius/pull/7000
* Enable Bicep recipe unit-test with fake registry server by @youngbupark in https://github.com/radius-project/radius/pull/7021
* Remove old issues workflow by @AaronCrawfis in https://github.com/radius-project/radius/pull/7020
* chore: replace issue templates with forms by @lechnerc77 in https://github.com/radius-project/radius/pull/6982
* Updating the caBundle for the controller webhook by @ytimocin in https://github.com/radius-project/radius/pull/7022
* Updating the Radius installation step of the long-haul workflow by @ytimocin in https://github.com/radius-project/radius/pull/7008
* Add Functional Test for Bicep Recipe Context Parameter by @kachawla in https://github.com/radius-project/radius/pull/7041
* Add event logging for Terraform recipe publishing by @sk593 in https://github.com/radius-project/radius/pull/7028
* Updating delete confirmation message by @ytimocin in https://github.com/radius-project/radius/pull/7049
* Avoid docker debian image ratelimitting issue in long running test by @youngbupark in https://github.com/radius-project/radius/pull/7067
* Make the properties field of tracked resource required by @vinayada1 in https://github.com/radius-project/radius/pull/6889
* Add check for Terraform submodules by @sk593 in https://github.com/radius-project/radius/pull/7013
* Support direct route connection in AppGraph by @youngbupark in https://github.com/radius-project/radius/pull/7072
* Fix connection direction by @youngbupark in https://github.com/radius-project/radius/pull/7076
* Support routes.*.destination of gateway for App Graph by @youngbupark in https://github.com/radius-project/radius/pull/7079
* Remove rad app switch reference from the error message by @akshayrohilla in https://github.com/radius-project/radius/pull/7083
* Fix release race condition by @willdavsmith in https://github.com/radius-project/radius/pull/6995
* Update versions.yaml for 0.30 rc by @vinayada1 in https://github.com/radius-project/radius/pull/7091
* Fix syntax error in release.yaml workflow by @willdavsmith in https://github.com/radius-project/radius/pull/7092
* Re-enable skipped test `Test_RecipeCommands` by @sk593 in https://github.com/radius-project/radius/pull/7080
* Create RC2 release version by @vinayada1 in https://github.com/radius-project/radius/pull/7093
* Add error handling in case release branch doesn't exist yet by @willdavsmith in https://github.com/radius-project/radius/pull/7094
* update versions file for rc3 release by @vinayada1 in https://github.com/radius-project/radius/pull/7096
14 changes: 11 additions & 3 deletions pkg/cli/clivalidation.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ func RequireResource(cmd *cobra.Command, args []string) (resourceType string, re
// are present. If either is missing, an error is returned.
func RequireResourceTypeAndName(args []string) (string, string, error) {
if len(args) < 2 {
return "", "", errors.New("No resource type or name provided")
return "", "", errors.New("no resource type or name provided")
}
resourceType, err := RequireResourceType(args)
if err != nil {
Expand All @@ -270,13 +270,21 @@ func RequireResourceType(args []string) (string, error) {
}
resourceTypeName := args[0]
supportedTypes := []string{}
foundTypes := []string{}
for _, resourceType := range clients.ResourceTypesList {
supportedType := strings.Split(resourceType, "/")[1]
supportedTypes = append(supportedTypes, supportedType)
if strings.EqualFold(supportedType, resourceTypeName) {
return resourceType, nil
//check to see if the resource type is the correct short or long name.
if strings.EqualFold(supportedType, resourceTypeName) || strings.EqualFold(resourceType, resourceTypeName) {
foundTypes = append(foundTypes, resourceType)
}
}
if len(foundTypes) == 1 {
return foundTypes[0], nil
} else if len(foundTypes) > 1 {
return "", fmt.Errorf("multiple resource types match '%s'. Please specify the full resource type and try again:\n\n%s\n",
resourceTypeName, strings.Join(foundTypes, "\n"))
}
return "", fmt.Errorf("'%s' is not a valid resource type. Available Types are: \n\n%s\n",
resourceTypeName, strings.Join(supportedTypes, "\n"))
}
Expand Down
82 changes: 82 additions & 0 deletions pkg/cli/clivalidation_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/*
Copyright 2024 The Radius Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package cli

import (
"errors"
"fmt"
"strings"
"testing"

"github.com/radius-project/radius/pkg/cli/clients"
"github.com/stretchr/testify/require"
)

func Test_RequireResourceType(t *testing.T) {

supportedTypes := []string{}

for _, resourceType := range clients.ResourceTypesList {
supportedType := strings.Split(resourceType, "/")[1]
supportedTypes = append(supportedTypes, supportedType)
}

resourceTypesErrorString := strings.Join(supportedTypes, "\n")

tests := []struct {
name string
args []string
want string
wantErr error
}{
{
name: "No arguments",
args: []string{},
want: "",
wantErr: errors.New("no resource type provided"),
},
{
name: "Supported resource type",
args: []string{"mongoDatabases"},
want: "Applications.Datastores/mongoDatabases",
wantErr: nil,
},
{
name: "Multiple resource types",
args: []string{"secretStores"},
want: "",
wantErr: fmt.Errorf("multiple resource types match 'secretStores'. Please specify the full resource type and try again:\n\nApplications.Dapr/secretStores\nApplications.Core/secretStores\n"),
},
{
name: "Unsupported resource type",
args: []string{"unsupported"},
want: "",
wantErr: fmt.Errorf("'unsupported' is not a valid resource type. Available Types are: \n\n" + resourceTypesErrorString + "\n"),
},
}

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got, err := RequireResourceType(tt.args)
if len(tt.want) > 0 {
require.Equal(t, tt.want, got)
} else {
require.Equal(t, tt.wantErr, err)
}
})
}
}
14 changes: 13 additions & 1 deletion pkg/cli/cmd/app/delete/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
"github.com/radius-project/radius/pkg/cli/output"
"github.com/radius-project/radius/pkg/cli/prompt"
"github.com/radius-project/radius/pkg/cli/workspaces"
"github.com/radius-project/radius/pkg/ucp/resources"
"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -82,6 +83,7 @@ type Runner struct {
Output output.Interface

ApplicationName string
EnvironmentName string
Scope string
Confirm bool
Workspace *workspaces.Workspace
Expand Down Expand Up @@ -121,6 +123,16 @@ func (r *Runner) Validate(cmd *cobra.Command, args []string) error {
return err
}

// Lookup the environment name for use in the confirmation prompt
if workspace.Environment != "" {
id, err := resources.ParseResource(workspace.Environment)
if err != nil {
return err
}

r.EnvironmentName = id.Name()
}

// Throw error if user specifies a Bicep filename or path instead of an application name
if strings.HasSuffix(r.ApplicationName, ".bicep") {
return clierrors.Message(bicepWarning, r.ApplicationName)
Expand All @@ -143,7 +155,7 @@ func (r *Runner) Validate(cmd *cobra.Command, args []string) error {
func (r *Runner) Run(ctx context.Context) error {
// Prompt user to confirm deletion
if !r.Confirm {
confirmed, err := prompt.YesOrNoPrompt(fmt.Sprintf(deleteConfirmation, r.ApplicationName, r.Workspace.Name), prompt.ConfirmNo, r.InputPrompter)
confirmed, err := prompt.YesOrNoPrompt(fmt.Sprintf(deleteConfirmation, r.ApplicationName, r.EnvironmentName), prompt.ConfirmNo, r.InputPrompter)
if err != nil {
return err
}
Expand Down
Loading

0 comments on commit 3813e86

Please sign in to comment.