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

SQL Ledger Cmdlets #14974

Closed
wants to merge 6 commits into from
Closed

SQL Ledger Cmdlets #14974

wants to merge 6 commits into from

Conversation

rewongmicrosoft
Copy link
Contributor

@rewongmicrosoft rewongmicrosoft commented May 13, 2021

Description

In progress PR for SQL Ledger cmdlets, see issue: https://github.com/Azure/azure-powershell-cmdlet-review-pr/issues/929
See SDK change here: Azure/azure-sdk-for-net#21021
Swagger change here: https://github.com/Azure/azure-rest-api-specs/pull/13916/files, https://github.com/Azure/azure-rest-api-specs/pull/13871/files

Adds ledger cmdlets, and pipes IsLedgerOn property for database creation. Also updating naming in other resources to match changes in SDK. Currently testing with local SDK version, will update once new version is published.

Checklist

  • I have read the Submitting Changes section of CONTRIBUTING.md
  • The title of the PR is clear and informative
  • The appropriate ChangeLog.md file(s) has been updated:
    • For any service, the ChangeLog.md file can be found at src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md
    • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header -- no new version header should be added
  • The PR does not introduce breaking changes
  • If applicable, the changes made in the PR have proper test coverage
  • For public API changes to cmdlets:

Copy link

@panant panant left a comment

Choose a reason for hiding this comment

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

Looks good overall.
let's add WhatIf and tests

src/Sql/Sql/Common/ResourceIdentityHelper.cs Show resolved Hide resolved
/// </summary>
[Parameter(Mandatory = false,
HelpMessage = "The enable ledger option for the Azure Sql Database")]
public SwitchParameter EnableLedger { get; set; }
Copy link

Choose a reason for hiding this comment

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

Since we don't allow alterting this, should this be part of the Set cmdlet?

.SYNOPSIS
Tests getting default ledger digest upload configuration
#>
function Test-GetDefaultLedgerDigestUpload
Copy link

Choose a reason for hiding this comment

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

For the Get case, we don't have various parameter options:name, resourceID, etc.? Only for Set?

Copy link

Choose a reason for hiding this comment

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

Oh it seems like we do but you test everything in one test?

$ledgerDigestUpload = Get-AzSqlDatabaseLedgerDigestUpload -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName

# Assert
Assert-AreEqual $ledgerDigestUpload.State "Disabled"
Copy link

Choose a reason for hiding this comment

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

So we only test Get for Disabled? Are the other scenarios tested as part of the Set tests?

@rewongmicrosoft
Copy link
Contributor Author

closed, use #14997

@wyunchi-ms wyunchi-ms deleted the rewongledger branch January 10, 2024 01:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants