Skip to content

Add WriteProgress and OpenProgress methods - #38

Open
halex2005 (halex2005) wants to merge 1 commit into
JetBrains:masterfrom
halex2005:master
Open

Add WriteProgress and OpenProgress methods#38
halex2005 (halex2005) wants to merge 1 commit into
JetBrains:masterfrom
halex2005:master

Conversation

@halex2005

Copy link
Copy Markdown

Hi!

  1. According to build-script-interaction-with-teamcity.html#reporting-build-progress, there should be support of

    ##teamcity[progressMessage '<message>']
    

    and

    ##teamcity[progressStart '<message>']
    ...some build activity...
    ##teamcity[progressFinish '<message>']
    

    service messages. This PR add this support.

  2. Also I've noted that build targets somewhat obolete and I've added netstandard2.0, net6.0 and net8.0 targets.

  3. I've also notices that WriteBuildProblem has required parameter named identity, bu documentation says that identity should be optional:

    identity (optional): a unique problem ID. Different problems must have different identity, same problems — same identity, 
    which should not change throughout builds if the same problem, for example, the same compilation error occurs. It must be 
    a valid Java ID up to 60 characters. If omitted, the identity is calculated based on the description text.
    

    So, I've added additional method without identity parameter to not break compatibility with existing code

Please, review this PR.

Cheers, Aleksei.

@boris-yakhno

Copy link
Copy Markdown
Collaborator

Hi halex2005 (@halex2005)! Thank you for the PR, we'll take a look at it this week.

<GenerateNeutralResourcesLanguageAttribute>true</GenerateNeutralResourcesLanguageAttribute>

<TargetFrameworks>netstandard1.3;net35;net40;net45;netcoreapp1.0;netcoreapp2.0;netcoreapp3.0</TargetFrameworks>
<TargetFrameworks>netstandard1.3;netstandard2.0;net35;net40;net45;netcoreapp1.0;netcoreapp2.0;netcoreapp3.0;net6.0;net8.0</TargetFrameworks>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Could you please share the reasoning behind adding new targets? As far as I understand, netstandard1.3 should cover all the frameworks that are covered by the added targets. Maybe some targets can even be removed, as netcoreapp1.0;netcoreapp2.0;netcoreapp3.0 seem redundant here.
I'm not sure what we should do with the target frameworks and I'm interested in hearing your opinion.

Comment on lines +5 to +23
/// <summary>
/// <para>
/// Use <see cref="WriteProgress"/> method to add progress message
/// <pre>
/// ##teamcity[progressMessage '&lt;message text>' ]
/// </pre>
/// </para>
///
/// <para>
/// Use <see cref="OpenProgress"/> method to add progress message
/// <pre>##teamcity[progressStart '&lt;message>']</pre>
/// and
/// <pre>##teamcity[progressFinish '&lt;message>']</pre>
/// on writer dispose.
/// </para>
/// <para>
/// http://confluence.jetbrains.net/display/TCD18/Build+Script+Interaction+with+TeamCity#BuildScriptInteractionwithTeamCity-ReportingMessagesForBuildLog
/// </para>
/// </summary>

@boris-yakhno Boris Yakhno (boris-yakhno) Sep 3, 2024

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

A couple of remarks:

I suggest something like this:

Suggested change
/// <summary>
/// <para>
/// Use <see cref="WriteProgress"/> method to add progress message
/// <pre>
/// ##teamcity[progressMessage '&lt;message text>' ]
/// </pre>
/// </para>
///
/// <para>
/// Use <see cref="OpenProgress"/> method to add progress message
/// <pre>##teamcity[progressStart '&lt;message>']</pre>
/// and
/// <pre>##teamcity[progressFinish '&lt;message>']</pre>
/// on writer dispose.
/// </para>
/// <para>
/// http://confluence.jetbrains.net/display/TCD18/Build+Script+Interaction+with+TeamCity#BuildScriptInteractionwithTeamCity-ReportingMessagesForBuildLog
/// </para>
/// </summary>
/// <summary>
/// <para>
/// Use the <see cref="WriteProgress"/> method to add a progress message:
/// <pre>##teamcity[progressMessage '&lt;message text>' ]</pre>
/// </para>
///
/// <para>
/// Use the <see cref="OpenProgress"/> method to add a progress start message:
/// <pre>##teamcity[progressStart '&lt;message>']</pre>
/// and a
/// <pre>##teamcity[progressFinish '&lt;message>']</pre>
/// progress finish message on writer dispose.
/// </para>
/// <para>
/// https://www.jetbrains.com/help/teamcity/service-messages.html#Reporting+Build+Progress
/// </para>
/// </summary>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Sorry, the documentation link in my previous comment was wrong. I have edited the comment to include the correct link.

public interface ITeamCityProgressWriter
{
/// <summary>
/// Writes normal message

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

How about "Writes a single progress message"?

void WriteProgress([NotNull] string message);

/// <summary>
/// Generates start flow message and returns disposable object to close flow

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

How about "Writes a progress start message and returns a disposable object that writes a progress finish message on dispose"?

@boris-yakhno

Copy link
Copy Markdown
Collaborator

Hi halex2005 (@halex2005)! The implementation looks good to me, I just have a question regarding the target frameworks and some minor comments on wording.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants