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

After latest release, prependEntryToOrderFile setting is being ignored #1855

Closed
andrewcrosher opened this issue Apr 9, 2024 · 7 comments · Fixed by #1856
Closed

After latest release, prependEntryToOrderFile setting is being ignored #1855

andrewcrosher opened this issue Apr 9, 2024 · 7 comments · Fixed by #1856
Assignees

Comments

@andrewcrosher
Copy link

Azure DevOps Extensions

WIKI Updater

Platform

Azure DevOps Services

Azure DevOps Server (TFS) Version

No response

Extension Version

No response

Describe the bug

Using the WikiUpdaterTask as part of our Azure DevOps release pipeline to publish release notes to wiki, I have noticed that the prependEntryToOrderFile setting has recently stopped working following the latest release on 4 April.

New release entries are no longer being prepended, they are being appended to the bottom of the list, which is the default behaviour

      - task: WikiUpdaterTask@2
        displayName: Publish Release Notes to Wiki
        inputs:
          repo: "https://dev.azure.com/myDomain/DomainName/_git/my.wiki"
          filename: "myFilename/Releases/$(Build.SourceBranchName)-Release.md"
          replaceFile: true
          dataIsFile: true
          sourceFile: '$(Build.SourcesDirectory)/release-notes/release-notes.md'
          message: 'Replace Release page for build $(Build.BuildId)'
          gitname: 'My Build Agent'
          gitemail: '[email protected]'
          useAgentToken: true
          injectExtraHeader: true
          updateOrderFile: true
          orderFilePath: "My.Wiki/Releases/Application-Releases"
          prependEntryToOrderFile: true

Repo Steps

  1. Run the app with the prependEntryToOrderFileset the true
  2. Run it again with a different name to generate a second wiki page
  3. The task will not error, but the setting is ignored and the new page will be appended to the bottom of the list

Expected Behavior

The prependEntryToOrderFile setting should ensure that any new pages are prepended to the top of the page list in the wiki

Logging Information

No response

@rfennell
Copy link
Owner

rfennell commented Apr 9, 2024

I can't see an obvious regression in the code, I will do some testing

@rfennell
Copy link
Owner

rfennell commented Apr 9, 2024

My test pipelines do seem to be honoring the prependEntryToOrderFile parameter for both the V2 an V3 version of the task.

What does your log file show?

Starting: Git based WIKI Updater - Azure DevOps with Creds update TestFolder/.order file
==============================================================================
Task         : Git based WIKI Single File Updater from Black Marble
Description  : A tools to update or create a file in a WIKI based in a Git repo 
Version      : 2.14.3
Author       : Richard Fennell
Help         : Version: 2.14.2. [More Information](https://github.com/rfennell/vNextBuild/wiki/Wiki-Updater-Task/)
==============================================================================
....
Variable: Commit Message [Update from Release - $(Release.ReleaseName) with Creds]
Variable: Git Username [builduser]
Variable: Git Email [build@demo]
Variable: Use Agent Token [false]
Variable: Replace File [true]
Variable: Append to File [true]
Variable: Username [richardfennell]
Variable: Password [*****]
Variable: LocalPath [C:\agents\richardfennell\_work\9\s/azurerepowithcreds]
Variable: Data Is File [false]
Variable: SourceFile [undefined]
Variable: Tag Repo [false]
Variable: Tag [undefined]
Variable: Branch [undefined]
Variable: InjectExtraHeader [false]
Variable: Retries [5]
Variable: trimLeadingSpecialChar [false]
Variable: fixLineFeeds [true]
Variable: fixSpaces [false]
Variable: insertLinefeed [false]
Variable: updateOrderFile [true]
Variable: prependEntryToOrderFile [true]
The provided repo URL is dev.azure.com/richardfennell/Git%20project/_git/Git-project.wiki
The protocol is https
The provided repo URL is dev.azure.com/richardfennell/Git%20project/_git/Git-project.wiki
Trimmed the URL to dev.azure.com/richardfennell/Git%20project/_git/Git-project.wiki
URL used https://richardfennell:***@dev.azure.com/richardfennell/Git%20project/_git/Git-project.wiki
Cleaned C:\agents\richardfennell\_work\9\s/azurerepowithcreds
Cloned dev.azure.com/richardfennell/Git%20project/_git/Git-project.wiki to C:\agents\richardfennell\_work\9\s/azurerepowithcreds
Setting GitConfig Name:builduser Email:build@demo
Set GIT values in C:\agents\richardfennell\_work\9\s/azurerepowithcreds
Pull in case of post clone updates from other users
Working file name is TestPageWithCreds-11953.md
Created the 'TestPageWithCreds-11953.md' in 'C:\agents\richardfennell\_work\9\s\azurerepowithcreds\TestFolder4' - fixing line-endings
Added TestFolder4/TestPageWithCreds-11953.md to repo C:\agents\richardfennell\_work\9\s/azurerepowithcreds
Updating the existing .order file
Preppending entry to the .order file
Committed file "C:\agents\richardfennell\_work\9\s/azurerepowithcreds" with message "Update from Release - $(Release.ReleaseName) with Creds" as SHA 263dfc1c
Attempt 1 - Push to dev.azure.com/richardfennell/Git%20project/_git/Git-project.wiki
Push completed

@andrewcrosher
Copy link
Author

seems to be reporting the same log as yours, but the observed behaviour was that the .order was not followed by the wiki. Could be a DevOps issue in that case?

Updating the existing .order file
Preppending entry to the .order file
Committed file "C:\a\5\s\repo" with message "Replace Release page for build 205111" as SHA b232de9e0
Attempt 1 - Push to https://dev.azure.com/myDomain/DomainName/_git/my.wiki
Push completed

@rfennell
Copy link
Owner

rfennell commented Apr 9, 2024

As the .order file is correct, then yes I assume the issue must lie in the way that Azure DevOps is rendering the page.

That said for me the .order file shows

TestPageWithCreds-11953
TestPageWithCreds-11946
TestPageWithCreds-11945
TestPageWithCreds-11944
TestPageWithCreds-11943
TestFolder4/TestPageWithCreds-9995

and that is the order I see

image

@andrewcrosher
Copy link
Author

andrewcrosher commented Apr 9, 2024

If it affects anything we are using a Provisioned Azure DevOps project wiki, rather than a normal code wiki. When i clone the repo and look at the file history of the .order file, the ones from the automated build agent stopped about a week ago - although it's only the .order file that is affected. The rest of the functionality is fine still.

@rfennell
Copy link
Owner

I have found the regression issue, it is related to the need to parallel ship a different version for Azure DevOps PPipeline V2 agents (Node10 based for Azure DevOps Server 2020 and older) and Azure DevOps Pipeline V3 agents the newer Node16 based agent.

The regression issue is now fixed in V2, but would also be fixed by swapping to V3 if you are not on Azure DevOps 2020 or older

The update is being deployed in the package 3.23.x (which include the V2 version too)

@andrewcrosher
Copy link
Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants