Skip to content

Commit a1d6836

Browse files
authored
Merge pull request #25 from tableau/release/4.1.0
Release 4.1.0
2 parents 353414e + 26583aa commit a1d6836

File tree

383 files changed

+12308
-1487
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

383 files changed

+12308
-1487
lines changed

.config/dotnet-tools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"isRoot": true,
44
"tools": {
55
"docfx": {
6-
"version": "2.75.3",
6+
"version": "2.76.0",
77
"commands": [
88
"docfx"
99
]

.github/workflows/dotnet-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ jobs:
3434
with:
3535
name: dotnet-results-${{ matrix.os }}-${{ matrix.config }}
3636
path: TestResults-${{ matrix.os }}-${{ matrix.config }}
37-
if-no-files-found: error
37+
if-no-files-found: error

.github/workflows/publishdocs-dryrun.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- uses: actions/checkout@v4
2424
- uses: ./.github/actions/setup-dotnet
2525
- name: Set up Python
26-
uses: actions/setup-python@v4
26+
uses: actions/setup-python@v5
2727
with:
2828
python-version: ${{ inputs.python-version }}
2929
- name: Generate API Reference Docs..

.github/workflows/publishdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
- uses: actions/checkout@v4
3838
- uses: ./.github/actions/setup-dotnet
3939
- name: Set up Python
40-
uses: actions/setup-python@v4
40+
uses: actions/setup-python@v5
4141
with:
4242
python-version: ${{ inputs.python-version }}
4343
- name: Generate API Reference Docs..

.github/workflows/python-package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
- uses: ./.github/actions/setup-dotnet
4444
if: ${{ env.PUBLISH_PACKAGE_KEY != '' && inputs.runs-on-config != 'self-hosted' }}
4545
- name: Set up Python
46-
uses: actions/setup-python@v4
46+
uses: actions/setup-python@v5
4747
if: ${{ env.PUBLISH_PACKAGE_KEY != '' && inputs.runs-on-config != 'self-hosted' }}
4848
with:
4949
python-version: ${{ vars.PYTHON_TEST_VERSIONS }}

.github/workflows/python-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- uses: actions/checkout@v4
2323
- uses: ./.github/actions/setup-dotnet
2424
- name: Set up Python
25-
uses: actions/setup-python@v4
25+
uses: actions/setup-python@v5
2626
with:
2727
python-version: ${{ vars.PYTHON_TEST_VERSIONS }}
2828
cache: 'pip' # caching pip dependencies

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<Nullable>enable</Nullable>
55
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
66
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
7-
<Version>4.0.0</Version>
7+
<Version>4.1.0</Version>
88
<Authors>Salesforce, Inc.</Authors>
99
<Company>Salesforce, Inc.</Company>
1010
<Copyright>Copyright (c) 2024, Salesforce, Inc. and its licensors</Copyright>

Migration SDK.sln

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ EndProject
5252
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{92044843-B4D7-4062-B1D5-DE7596072E33}"
5353
ProjectSection(SolutionItems) = preProject
5454
scripts\generate-docs.ps1 = scripts\generate-docs.ps1
55+
scripts\sync-release-settings.json = scripts\sync-release-settings.json
56+
scripts\sync-release.ps1 = scripts\sync-release.ps1
5557
EndProjectSection
5658
EndProject
5759
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DependencyInjection.ExampleApplication", "examples\DependencyInjection.ExampleApplication\DependencyInjection.ExampleApplication.csproj", "{99DA12FB-BB16-4EE1-9C9C-047755210255}"

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ The Tableau Migration SDK is a client library to build an application to facilit
1111
Quickstart:
1212
- Install a [.NET Runtime](https://dotnet.microsoft.com/en-us/download).
1313
- For Python install using PIP:
14-
- [PIP CLI](https://pip.pypa.io/en/stable/cli/pip_install): `pip install tableau-migration`
14+
- [PIP CLI](https://pip.pypa.io/en/stable/cli/pip_install): `pip install tableau_migration`
1515
- For C# install using NuGet:
16-
- [dotnet CLI](https://learn.microsoft.com/en-us/nuget/quickstart/install-and-use-a-package-using-the-dotnet-cli): `dotnet add package Tableau.Migration --version 1.0.0`
16+
- [dotnet CLI](https://learn.microsoft.com/en-us/nuget/quickstart/install-and-use-a-package-using-the-dotnet-cli): `dotnet add package Tableau.Migration`
1717
- [Nuget Package Manager](https://learn.microsoft.com/en-us/nuget/quickstart/install-and-use-a-package-in-visual-studio): Search for `Tableau.Migration`.
18-
- Then check out our [code samples](https://tableau.github.io/migration-sdk/samples/intro.html).
18+
- Then check out our [code samples](https://tableau.github.io/migration-sdk/samples/index.html).
1919

2020
To look at source code and delve deeper, first clone the repo:
2121

examples/Csharp.ExampleApplication/Csharp.ExampleApplication.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
55
<!-- Don't warn on ConfigureAwait on console application, Don't require license headers for sample code -->
66
<NoWarn>CA2007,IDE0073</NoWarn>
7-
<UserSecretsId>7d7631f1-dc4a-49de-89d5-a194544705c1</UserSecretsId>
7+
<UserSecretsId>8368baab-103b-45f6-bfb1-f89a537f4f3c</UserSecretsId>
88
</PropertyGroup>
99
<ItemGroup>
1010
<ProjectReference Include="../../src/Tableau.Migration/Tableau.Migration.csproj" />

examples/Csharp.ExampleApplication/Hooks/Transformers/EncryptExtractTransformer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class EncryptExtractsTransformer<T> : ContentTransformerBase<T> where T :
1515
{
1616
private readonly ILogger<IContentTransformer<T>>? _logger;
1717

18-
public EncryptExtractsTransformer(ISharedResourcesLocalizer? localizer, ILogger<IContentTransformer<T>>? logger) : base(localizer, logger)
18+
public EncryptExtractsTransformer(ISharedResourcesLocalizer localizer, ILogger<IContentTransformer<T>> logger) : base(localizer, logger)
1919
{
2020
_logger = logger;
2121
}

examples/Csharp.ExampleApplication/Hooks/Transformers/MigratedTagTransformer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class MigratedTagTransformer<T> : ContentTransformerBase<T> where T : ICo
1515
{
1616
private readonly ILogger<IContentTransformer<T>>? _logger;
1717

18-
public MigratedTagTransformer(ISharedResourcesLocalizer? localizer, ILogger<IContentTransformer<T>>? logger) : base(localizer, logger)
18+
public MigratedTagTransformer(ISharedResourcesLocalizer localizer, ILogger<IContentTransformer<T>> logger) : base(localizer, logger)
1919
{
2020
_logger = logger;
2121
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
using System.Threading;
2+
using System.Threading.Tasks;
3+
using Microsoft.Extensions.Logging;
4+
using Tableau.Migration.Content.Schedules;
5+
using Tableau.Migration.Content.Schedules.Cloud;
6+
using Tableau.Migration.Engine.Hooks.Transformers;
7+
using Tableau.Migration.Resources;
8+
9+
namespace Csharp.ExampleApplication.Hooks.Transformers
10+
{
11+
#region class
12+
public class SimpleScheduleStartAtTransformer<T>
13+
: ContentTransformerBase<T>
14+
where T : IWithSchedule<ICloudSchedule>
15+
{
16+
private readonly ILogger<IContentTransformer<T>>? _logger;
17+
18+
public SimpleScheduleStartAtTransformer(
19+
ISharedResourcesLocalizer localizer,
20+
ILogger<IContentTransformer<T>> logger)
21+
: base(
22+
localizer,
23+
logger)
24+
{
25+
_logger = logger;
26+
}
27+
28+
public override async Task<T?> TransformAsync(
29+
T itemToTransform,
30+
CancellationToken cancel)
31+
{
32+
// In this example, the `Start At` time is in the UTC time zone.
33+
if (itemToTransform.Schedule.FrequencyDetails.StartAt is not null)
34+
{
35+
// A simple conversion to the EDT time zone.
36+
var updatedStartAt = itemToTransform.Schedule.FrequencyDetails.StartAt.Value.AddHours(-4);
37+
38+
_logger?.LogInformation(
39+
@"Adjusting the 'Start At' from {previousStartAt} to {updatedStartAt}.",
40+
itemToTransform.Schedule.FrequencyDetails.StartAt.Value,
41+
updatedStartAt);
42+
43+
itemToTransform.Schedule.FrequencyDetails.StartAt = updatedStartAt;
44+
}
45+
46+
return await Task.FromResult(itemToTransform);
47+
}
48+
}
49+
#endregion
50+
}

examples/Csharp.ExampleApplication/MyMigrationApplication.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
using Microsoft.Extensions.Options;
1616
using Tableau.Migration;
1717
using Tableau.Migration.Content;
18+
using Tableau.Migration.Content.Schedules.Cloud;
1819
using Tableau.Migration.Engine.Pipelines;
1920

2021
#region namespace
@@ -120,6 +121,10 @@ public async Task StartAsync(CancellationToken cancel)
120121
_planBuilder.Transformers.Add<EncryptExtractsTransformer<IPublishableWorkbook>, IPublishableWorkbook>();
121122
#endregion
122123

124+
#region StartAtTransformer-Registration
125+
_planBuilder.Transformers.Add<SimpleScheduleStartAtTransformer<ICloudExtractRefreshTask>, ICloudExtractRefreshTask>();
126+
#endregion
127+
123128
// Add migration action completed hooks
124129
#region LogMigrationActionsHook-Registration
125130
_planBuilder.Hooks.Add<LogMigrationActionsHook>();
@@ -131,6 +136,7 @@ public async Task StartAsync(CancellationToken cancel)
131136
_planBuilder.Hooks.Add<LogMigrationBatchesHook<IProject>>();
132137
_planBuilder.Hooks.Add<LogMigrationBatchesHook<IDataSource>>();
133138
_planBuilder.Hooks.Add<LogMigrationBatchesHook<IWorkbook>>();
139+
_planBuilder.Hooks.Add<LogMigrationBatchesHook<ICloudExtractRefreshTask>>();
134140
#endregion
135141

136142
// Build the plan

examples/Csharp.ExampleApplication/Program.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ public static IServiceCollection AddCustomizations(this IServiceCollection servi
8787
services.AddScoped<EncryptExtractsTransformer<IPublishableWorkbook>>();
8888
#endregion
8989

90+
#region StartAtTransformer-DI
91+
services.AddScoped(typeof(SimpleScheduleStartAtTransformer<>));
92+
#endregion
93+
9094
#region LogMigrationActionsHook-DI
9195
services.AddScoped<LogMigrationActionsHook>();
9296
#endregion

examples/Csharp.ExampleApplication/appsettings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@
3232
{
3333
"type": "workbook",
3434
"batchSize": 90
35+
},
36+
{
37+
"type": "serverextractrefreshtask",
38+
"batchSize": 100
3539
}
3640
]
3741
},

examples/Python.ExampleApplication/Hooks/mappings/email_domain_mapping.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def map(self, ctx: ContentMappingContext[IUser]) -> ContentMappingContext[IUser]
1111
_tableau_user_domain = ctx.mapped_location.parent()
1212

1313
# Re-use an existing email if it already exists.
14-
if not ctx.content_item.email:
14+
if ctx.content_item.email:
1515
return ctx.map_to(_tableau_user_domain.append(ctx.content_item.email))
1616

1717
# Takes the existing username and appends the domain to build the email
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from datetime import time
2+
from tableau_migration import (
3+
ContentTransformerBase,
4+
ICloudExtractRefreshTask
5+
)
6+
7+
class SimpleScheduleStartAtTransformer(ContentTransformerBase[ICloudExtractRefreshTask]):
8+
def transform(self, itemToTransform: ICloudExtractRefreshTask) -> ICloudExtractRefreshTask:
9+
# In this example, the `Start At` time is in the UTC time zone.
10+
if itemToTransform.schedule.frequency_details.start_at:
11+
prev_start_at = itemToTransform.schedule.frequency_details.start_at
12+
# A simple conversion to the EDT time zone.
13+
itemToTransform.schedule.frequency_details.start_at = time(prev_start_at.hour - 4, prev_start_at.minute, prev_start_at.second, prev_start_at.microsecond);
14+
15+
return itemToTransform

examples/Python.ExampleApplication/Python.ExampleApplication.pyproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
<Compile Include="hooks\post_publish\bulk_logging_hook.py" />
3333
<Compile Include="hooks\transformers\encrypt_extracts_transformer.py" />
3434
<Compile Include="hooks\transformers\migrated_tag_transformer.py" />
35+
<Compile Include="Hooks\transformers\schedule_startat_transformer.py" />
3536
<Compile Include="print_result.py" />
3637
<Compile Include="Python.ExampleApplication.py" />
3738
</ItemGroup>
Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
--index-url https://artifactory.prod.tableautools.com/artifactory/api/pypi/tabpypi/simple
2-
--pre
3-
pip==24.0.0
4-
setuptools==69.1.0
5-
configparser==6.0.0
1+
setuptools==70.1.1
2+
configparser==7.0.0
63
tableau_migration
74
cffi==1.16.0
8-
pycparser==2.21
5+
pycparser==2.22
96
pythonnet==3.0.3
10-
typing_extensions==4.9.0
7+
typing_extensions==4.12.2

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "8.0.201",
3+
"version": "8.0.302",
44
"rollForward": "latestMajor"
55
}
66
}

scripts/generate-docs.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ $main_docs_dir = Join-Path $root_dir "src/Documentation"
4949
$sphinx_output_dir = Join-Path $python_dir "Documentation/generated"
5050

5151
# Directory for Python wrapper files. Includes an index file and a directory for autogenerated files.
52-
$python_wrapper_dir = Join-Path $main_docs_dir "api-python";
52+
$python_apiref_dir = Join-Path $main_docs_dir "api-python";
5353

5454
$python_reference_dir_name = "reference";
5555

5656
# Directory where DocFX looks for markdown files to render into our 'Python Wrapper' section.
57-
$python_md_destination = Join-Path $python_wrapper_dir $python_reference_dir_name;
57+
$python_md_destination = Join-Path $python_apiref_dir $python_reference_dir_name;
5858

5959
function Run-Command {
6060
param([string]$Cmd)
@@ -152,7 +152,7 @@ function Write-Python-docs {
152152
Run-Command ("python -m pip install -q --upgrade pip");
153153
Run-Command ("python -m pip install -q hatch");
154154
Run-Command ("Clear-Directory -Path $sphinx_output_dir");
155-
Run-Command ("python -m hatch run docs:sphinx-build -M markdown $sphinx_build_dir $sphinx_output_dir -q");
155+
Run-Command ("python -m hatch run docs:sphinx-build -M markdown $sphinx_build_dir $sphinx_output_dir -Q");
156156
Run-Command ("Pop-Location");
157157
Write-Host-With-Timestamp "Finished: Generating python docs.";
158158

@@ -269,7 +269,7 @@ function Write-Python-Docs-Toc {
269269
}
270270
}
271271

272-
$tocPath = Join-Path -Path $python_wrapper_dir -ChildPath toc.yml;
272+
$tocPath = Join-Path -Path $python_apiref_dir -ChildPath toc.yml;
273273

274274
Run-Command ("Out-File -FilePath '$tocPath' -InputObject '$($fileContent | Out-String)'");
275275

@@ -290,7 +290,7 @@ function Write-Final-Docs {
290290

291291
# Docfx related paths
292292
$docfx_config_path = Join-Path $main_docs_dir "docfx.json";
293-
$docfx_cmd = "dotnet docfx $docfx_config_path -t statictoc,templates\tableau --logLevel warning";
293+
$docfx_cmd = "dotnet docfx $docfx_config_path -t default,statictoc,templates\tableau --logLevel warning";
294294

295295
# Run the docfx command to generate the final output
296296
if ($Serve) {

src/Documentation/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@
66
/**/packages/
77
/**/bin/
88
/**/obj/
9-
_site
109
migration_sdk_metadata.json

src/Documentation/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ Content in Tab 3
148148
##### Using regions (Preferred method)
149149

150150
```markdown
151-
[!code-csharp[CS](../../../../examples/Csharp.ExampleApplication/MyMigrationApplication.cs#DefaultProjectsFilter-Registration)]
151+
[!code-csharp[](../../../../examples/Csharp.ExampleApplication/MyMigrationApplication.cs#DefaultProjectsFilter-Registration)]
152152
```
153153

154154
##### Using line numbers
@@ -157,7 +157,7 @@ Content in Tab 3
157157
> Use these very sparingly for C#. When the code is edited, it can change line numbers and mess up code snippets.
158158
159159
```markdown
160-
[!code-csharp[CS](../../../../examples/Csharp.ExampleApplication/Hooks/Mappings/EmailDomainMapping.cs#L8-)]
160+
[!code-csharp[](../../../../examples/Csharp.ExampleApplication/Hooks/Mappings/EmailDomainMapping.cs#L8-)]
161161
```
162162

163163
> [!IMPORTANT]

src/Documentation/api-csharp/index.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@ Welcome to the C# API Reference for the Migration SDK.
44

55
## Examples to get started
66

7-
The following code samples are for writing a simple migration app using the Migration SDK. For details on configuring and customizing the Migration SDK to your specific needs, see [Articles](~/articles/intro.md) and [Code Samples](~/samples/intro.md).
7+
The following code samples are for writing a simple migration app using the Migration SDK. For details on configuring and customizing the Migration SDK to your specific needs, see [Articles](~/articles/index.md) and [Code Samples](~/samples/index.md).
88

99
### [Program.cs](#tab/program-cs)
1010

11-
[!code-csharp[CS](../../../examples/Csharp.ExampleApplication/Program.cs#namespace)]
11+
[!code-csharp[](../../../examples/Csharp.ExampleApplication/Program.cs#namespace)]
1212

1313
### [Startup code](#tab/startup-cde)
1414

15-
[!code-csharp[CS](../../../examples/Csharp.ExampleApplication/MyMigrationApplication.cs#namespace)]
15+
[!code-csharp[](../../../examples/Csharp.ExampleApplication/MyMigrationApplication.cs#namespace)]
1616

1717
### [Config classes](#tab/config-classes)
1818

19-
[!code-csharp[CS](../../../examples/Csharp.ExampleApplication/Config/MyMigrationApplicationOptions.cs#namespace)]
19+
[!code-csharp[](../../../examples/Csharp.ExampleApplication/Config/MyMigrationApplicationOptions.cs#namespace)]
2020

21-
[!code-csharp[CS](../../../examples/Csharp.ExampleApplication/Config/EndpointOptions.cs#namespace)]
21+
[!code-csharp[](../../../examples/Csharp.ExampleApplication/Config/EndpointOptions.cs#namespace)]
2222

2323
### [Config file](#tab/appsettings)
2424

@@ -43,5 +43,5 @@ The following code samples are for writing a simple migration app using the Migr
4343

4444
## Suggested Reading
4545

46-
- [Code Samples](~/samples/intro.md)
47-
- [Articles](~/articles/intro.md)
46+
- [Code Samples](~/samples/index.md)
47+
- [Articles](~/articles/index.md)

src/Documentation/api-python/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ There are advanced features of the Migration SDK that the Python Wrapper cannot
2222

2323
## Examples to get started
2424

25-
The following code samples are for writing a simple migration app using the Migration SDK. For details on configuring and customizing the Migration SDK to your specific needs, see [Articles](~/articles/intro.md) and [Code Samples](~/samples/intro.md).
25+
The following code samples are for writing a simple migration app using the Migration SDK. For details on configuring and customizing the Migration SDK to your specific needs, see [Articles](~/articles/index.md) and [Code Samples](~/samples/index.md).
2626

2727
### [Startup Script](#tab/startup)
2828

0 commit comments

Comments
 (0)