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

Extract Artifacts Root path out of Artifacts path #822

Closed
YevgeniyShunevych opened this issue Feb 17, 2024 · 0 comments
Closed

Extract Artifacts Root path out of Artifacts path #822

YevgeniyShunevych opened this issue Feb 17, 2024 · 0 comments
Assignees
Milestone

Comments

@YevgeniyShunevych
Copy link
Member

YevgeniyShunevych commented Feb 17, 2024

Before the v3, Artifacts path was an absolute path to AtataContext artifacts.
Now Artifacts path is split into 2 parts, basically it becomes a path relative to Artifacts Root.

Default Artifacts Root path is "{basedir}/artifacts/{build-start:yyyyMMddTHHmmss}".
Default Artifacts path is "{test-suite-name-sanitized:/*}{test-name-sanitized:/*}".

ArtifactsRoot properties and methods are located in AtataContext.GlobalProperties:

/// <summary>
/// Gets or sets the Artifacts Root path template.
/// The default value is <c>"{basedir}/artifacts/{build-start:yyyyMMddTHHmmss}"</c>.
/// </summary>
public string ArtifactsRootPathTemplate { get; set; }

/// <summary>
/// Gets the <see cref="DirectorySubject"/> of Artifacts Root directory.
/// <see cref="ArtifactsRootPathTemplate"/> property is used to configure the Artifacts Root path.
/// </summary>
public DirectorySubject ArtifactsRoot { get; }

/// <summary>
/// Gets the path of Artifacts Root directory.
/// <see cref="ArtifactsRootPathTemplate"/> property is used to configure the Artifacts Root path.
/// </summary>
public string ArtifactsRootPath { get; }

/// <summary>
/// <para>
/// Sets the path template of the Artifacts Root directory.
/// The default value is <c>"{basedir}/artifacts/{build-start:yyyyMMddTHHmmss}"</c>.
/// </para>
/// <para>
/// The list of supported variables:
/// </para>
/// <list type="bullet">
/// <item><c>{basedir}</c></item>
/// <item><c>{build-start}</c></item>
/// <item><c>{build-start-utc}</c></item>
/// </list>
/// </summary>
/// <param name="directoryPathTemplate">The directory path template.</param>
/// <returns>The same <see cref="AtataContextGlobalProperties"/> instance.</returns>
public AtataContextGlobalProperties UseArtifactsRootPathTemplate(string directoryPathTemplate);

/// <summary>
/// Sets the default Artifacts root path template with optionally
/// including <c>"{build-start:yyyyMMddTHHmmss}"</c> folder in the path.
/// </summary>
/// <param name="include">Whether to include the <c>"{build-start:yyyyMMddTHHmmss}"</c> folder in the path.</param>
/// <returns>The same <see cref="AtataContextGlobalProperties"/> instance.</returns>
public AtataContextGlobalProperties UseDefaultArtifactsRootPathTemplateIncludingBuildStart(bool include);

Removed AtataContextBuilder Artifacts configuration methods:

public AtataContextBuilder UseArtifactsPath(string directoryPath);

public AtataContextBuilder UseArtifactsPath(Func<AtataContext, string> directoryPathBuilder);

public AtataContextBuilder UseDefaultArtifactsPathIncludingBuildStart(bool include);

New AtataContextBuilder Artifacts configuration method:

public AtataContextBuilder UseArtifactsPathTemplate(string directoryPathTemplate);
@YevgeniyShunevych YevgeniyShunevych added this to the 3.0.0 milestone Feb 17, 2024
@YevgeniyShunevych YevgeniyShunevych self-assigned this Feb 17, 2024
YevgeniyShunevych added a commit that referenced this issue Feb 17, 2024
- #823 Move `TimeZone` instance property of `AtataContext` to `AtataContext.GlobalProperties`.
- #824 Move `BuildStart` and `BuildStartUtc` static properties of `AtataContext` to `AtataContext.GlobalProperties`.
- #825 Move `ModeOfCurrent` static property of `AtataContext` to `AtataContext.GlobalProperties`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant