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

MVP #2

Merged
merged 49 commits into from
Aug 28, 2024
Merged

MVP #2

merged 49 commits into from
Aug 28, 2024

Conversation

snovak7
Copy link
Collaborator

@snovak7 snovak7 commented May 17, 2024

Closes #1

@snovak7 snovak7 added the enhancement New feature or request label May 17, 2024
@snovak7 snovak7 added this to the Alpha milestone May 17, 2024
@snovak7 snovak7 self-assigned this May 17, 2024
@snovak7 snovak7 linked an issue May 17, 2024 that may be closed by this pull request
14 tasks
if (assemblies.Length == 0)
{
// scan all domain
_loadedTypes.AddRange(AppDomain.CurrentDomain.GetAssemblies().SelectMany(assembly => assembly.GetTypes()));

Choose a reason for hiding this comment

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

This is non-deterministic and should be in an activity which returns the list.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't think we can achieve non-deterministic behavior here

Choose a reason for hiding this comment

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

we absolutely can by running this in an activity

src/Migrator/MigrationWorkflow.cs Outdated Show resolved Hide resolved
@snovak7 snovak7 marked this pull request as ready for review May 20, 2024 19:40
@snovak7 snovak7 marked this pull request as draft May 20, 2024 19:41
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.SourceLink.GitHub">

Choose a reason for hiding this comment

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

Consider adding PublicApiAnalyzer

GitVersion.yml Outdated
@@ -0,0 +1,6 @@
mode: ContinuousDeployment
branches:
master:

Choose a reason for hiding this comment

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

should this be main?

Suggested change
master:
main:

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, actually I don't know for sure, I know that behind these names there are regex statements
as here https://gitversion.net/docs/reference/configuration#branch-configuration

And yes they changed to main apparently, but also isn't being used

@@ -0,0 +1,6 @@
mode: ContinuousDeployment

Choose a reason for hiding this comment

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

What is this? Haven't seen it before

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You can ignore it, as it is not really used, I copied from my solutions, what it does if you would have main branch, it would version your package/dll with -rc.X, where X is being n commits from your starting point, or last version... but since it's only tag [commit] everything is ignored

global.json Outdated
"sdk": {
"version": "8.0.200"
}
}

Choose a reason for hiding this comment

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

Suggested change
}
}

public interface IMigration
{
/// <summary>
/// Execute.

Choose a reason for hiding this comment

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

Suggested change
/// Execute.
/// Execute the migration.

/// <inheritdoc />
public TypeJsonConverter()
{
_loadedTypes = GlobalReflector

Choose a reason for hiding this comment

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

I feel like Global reflector should be injectable so it's easier to test.

[Fact]
public async Task TemporalWorkflowFromStartToFinish()
{
await _temporalClient

Choose a reason for hiding this comment

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

/// <inheritdoc />
public ValueTask ExecuteAsync(CancellationToken cancellationToken)
{
cancellationToken.ThrowIfCancellationRequested();

Choose a reason for hiding this comment

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

It might actually be easier to have the workflow be started here vs in the caller

/// </summary>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>A <see cref="Task"/> representing the result of the asynchronous operation.</returns>
ValueTask ExecuteAsync(CancellationToken cancellationToken);

Choose a reason for hiding this comment

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

I think it makes sense here to expose mechanism to register dependencies in a container.

We should probably have a scoped container each migration.

// Copyright (c) InfinityFlow. All Rights Reserved.
// Licensed under the Apache 2.0. See LICENSE file in the solution root for full license information.

[assembly: CLSCompliant(false)]

Choose a reason for hiding this comment

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

Same comment as above

@snovak7 snovak7 marked this pull request as ready for review July 6, 2024 18:42
@snovak7 snovak7 requested a review from ElanHasson July 6, 2024 18:42
@snovak7 snovak7 merged commit 99803e9 into main Aug 28, 2024
1 check passed
@snovak7 snovak7 deleted the 1-mvp branch August 28, 2024 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Temporal-Migrator: MVP
2 participants