Skip to content

Commit

Permalink
Release 3.0.0 missed files
Browse files Browse the repository at this point in the history
  • Loading branch information
drache42 committed May 13, 2024
1 parent 7d94c68 commit 0304947
Show file tree
Hide file tree
Showing 34 changed files with 1,597 additions and 97 deletions.
File renamed without changes.
19 changes: 0 additions & 19 deletions src/Documentation/articles/python_wrapper.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# Troubleshooting

## Migration fails due to invalid credentials
## Common issues

### Migration fails due to invalid credentials

1. Make sure credentials are correct in Migration SDK configuration.
2. If they are incorrect/absent, [Create a Personal Access Token (PAT)](https://help.tableau.com/current/server/en-us/security_personal_access_tokens.htm#:~:text=Create%20personal%20access%20tokens,-Users%20must%20create&text=Users%20with%20accounts%20on%20Tableau,have%20up%20to%2010%20PATs) and use them in the Migration SDK configuration.

## The migration has finished but I do not see the expected content on the destination
### The migration has finished but I do not see the expected content on the destination

When the migration finishes you get a [MigrationResult](xref:Tableau.Migration.MigrationResult). The [MigrationCompletionStatus](xref:Tableau.Migration.MigrationCompletionStatus) should be `Canceled` or `FatalError`. In the [Manifest](xref:Tableau.Migration.IMigrationManifest) check
When the migration finishes you get a [MigrationResult](xref:Tableau.Migration.MigrationResult). The [MigrationCompletionStatus](xref:Tableau.Migration.MigrationCompletionStatus) should be `Canceled` or `FatalError`. In the [Manifest](xref:Tableau.Migration.IMigrationManifest), check

- Errors: The top level errors not related to any manifest entries.
- [Entries](xref:Tableau.Migration.Engine.Manifest.IMigrationManifestEntryCollection): This is a collection of manifest entries that can be grouped by content type. Here are code snippets that log those errors. You can use this as general reference to process migration errors in your application.
Expand Down Expand Up @@ -58,3 +60,15 @@ Python
if entry.Destination is not None:
_logger.LogInformation(f"{content_type.Name} {entry.Source.Location} migrated to {entry.Destination.Location}")
```

## Errors and Warnings

This section provides a list of potential error and warning log messages that you may encounter in the logs. Each entry includes a description to assist you in debugging.

### Warning: `Could not add a user to the destination Group [group name]. Reason: Could not find the destination user for [user name].`

This warning message indicates that the `GroupUsersTransformer` was unable to add the user, denoted as `[user name]`, to the group, denoted as `[group name]`.

This situation can occur if a user was excluded by a custom filter, but was not mapped to another user. If a custom filter was implemented based on the `ContentFilterBase<IUser>` class, then debug logging is already available.

To resolve this issue, enable debug logging to identify which filter is excluding the user. Then, add a mapping to an existing user using the `ContentMappingBase<IUser>` class.
11 changes: 0 additions & 11 deletions src/Documentation/articles/troubleshooting/errors.md

This file was deleted.

40 changes: 40 additions & 0 deletions src/Documentation/python_wrapper/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Python Wrapper

The Migration SDK is written in .NET. It has a Python wrapper package that provides access to most of this functionality.

## Capabilities

With the Python Wrapper, you can:

- Provide basic [configuration](~/articles/configuration.md) values to the Migration SDK via the PlanBuilder.
- Set configuration options as described in [Configuration](~/articles/configuration.md) with environment variables.
- Configure Python [logging](~/articles/logging.md#python-support).
- Run a migration using the wrapper.
- Write [Python hooks](~/samples/python_hooks.md) (See [Hooks](~/articles/hooks/index.md) for an overview).

## Current limitations

There are advanced features of the Migration SDK that the Python Wrapper cannot currently access:

- Override `C#` classes and methods to change how the SDK works.

## Examples to get started

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).

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

[!code-python[](../../../examples/Python.ExampleApplication/Python.ExampleApplication.py)]

### [config.ini](#tab/config)

> [!Important]
> The values below should not be quoted. So ***no*** `'` or `"`.
[!code-ini[](../../../examples/Python.ExampleApplication/config.ini)]

### [requirements.txt](#tab/reqs)

[!code-text[](../../../examples/Python.ExampleApplication/requirements.txt#L3-)]

---
36 changes: 0 additions & 36 deletions src/Documentation/samples/csharp.md

This file was deleted.

18 changes: 0 additions & 18 deletions src/Documentation/samples/python.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
# Hooks Implemented in Python

Because the Migration SDK is primarily written in C#, it uses [Python.NET](https://pythonnet.github.io/) to enable the implementation of hooks in Python. The Python hooks interoperate with the C# binaries to achieve the same results as writing hooks in C#.
Because the Migration SDK is primarily written in C#, it uses [Python.NET](https://pythonnet.github.io/) to enable the implementation of [hooks](~/samples/python_hooks.md) in Python. The Python hooks interoperate with the C# binaries to achieve the same results as writing hooks in C#.

The SDK's C# hook classes and interfaces are [asynchronous](https://learn.microsoft.com/en-us/dotnet/csharp/asynchronous-programming/). Due to the limitations of [Python.NET](https://pythonnet.github.io/), the SDK provides synchronous wrappers to these interfaces. The names of these wrappers start with the keyword `ISync`. You will find references to those in the following examples.
The SDK's C# hook classes and interfaces are [asynchronous](https://learn.microsoft.com/en-us/dotnet/csharp/asynchronous-programming/). Due to the limitations of [Python.NET](https://pythonnet.github.io/), the SDK provides synchronous wrappers to these interfaces. The names of these wrappers start with the keyword `ISync`. You will find references to those in the following examples.

Various C# interfaces and classes are used in hooks. You will need to import them just like you do Python classes. You can search for them in the [API Reference](~/api/index.md) section of the documentation.

Example:

Here is one of the import statements you will need for filters

```python
from Tableau.Migration.Interop.Hooks.Filters import ISyncContentFilter
```
The namespace for `ISyncContentFilter` is `Tableau.Migration.Interop.Hooks.Filters`.

The namespace for `ISyncContentFilter` is `Tableau.Migration.Interop.Hooks.Filters`.

## Object Registration

Expand Down
84 changes: 84 additions & 0 deletions src/Python/scripts/publish-package.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<#
.SYNOPSIS
Builds and publishes the migration-sdk python package
.NOTES
Author: Steffen Froehlich
.PARAMETER SkipPublish
Builds everything but skips pushing to repository
.PARAMETER VersionOverride
String used to override the version in the Directory.Build.props file in the root directory.
The Python Hatchling project is required for this: https://pypi.org/project/hatchling/
#>

[CmdletBinding()]
param(
[switch]$SkipPublish,
[string]$VersionOverride
)

function Test-CommandExists ($command)
{
$oldPreference = $ErrorActionPreference

$ErrorActionPreference = 'stop'

try {
if(Get-Command $command) {
return $true
}
}
catch {
return $false
}
finally {
$ErrorActionPreference=$oldPreference
}
}

pushd (Join-Path $PSScriptRoot "..")

$env:TWINE_REPOSITORY="tabpypi"
$env:TWINE_REPOSITORY_URL="https://artifactory.prod.tableautools.com/artifactory/api/pypi/tabpypi"
$env:TWINE_USERNAME="svc_cmt"
$env:TWINE_NON_INTERACTIVE="1"

if (-not($SkipPublish)) {
if( [string]::IsNullOrEmpty($env:TWINE_PASSWORD) ) {
Write-Error "Set `$env:TWINE_PASSWORD to the svc_cmd password found in cyberark"
exit 1
}
}
if ($VersionOverride) {
if( -not(Test-CommandExists hatch)) {
Write-Error "install hatch to set custom version. 'pip install hatch'"
exit 1
}
}

try {
& (Join-Path $PSScriptRoot "build-package.ps1")

if ($VersionOverride) {
$oldVersion = (hatch version)
hatch version $VersionOverride
}
python -m build --wheel # Build the wheel package
python -m build --sdist # Build the source dist package

if (-not($SkipPublish)) {
# The package will be uploaded to https://artifactory.prod.tableautools.com/ui/repos/tree/General/tabpypi/tableau-migration/
Write-Host "Uploading package to https://artifactory.prod.tableautools.com/ui/repos/tree/General/tabpypi/tableau-migration/"
python -m twine upload --repository-url https://artifactory.prod.tableautools.com/artifactory/api/pypi/tabpypi dist/*
}

}
finally {
popd

if ($oldVersion){
hatch version $oldVersion
}
}
Loading

0 comments on commit 0304947

Please sign in to comment.