Skip to content

Enable publishing build artifacts in PR #180

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

Closed
wants to merge 11 commits into from

Conversation

carlossanlop
Copy link
Member

Fixes #164

@carlossanlop
Copy link
Member Author

carlossanlop commented Nov 14, 2024

The artifacts are getting successfully published: https://dev.azure.com/dnceng-public/public/_build/results?buildId=870307&view=artifacts&pathAsName=false&type=publishedArtifacts

But there might be bugs:

  • There's a duplicate "Publish logs" step.
  • Artifacts_WindowsNT_Release and Artifacts_WindowsNT_Debug are only publishing the packages of the assemblies that currently have IsPackable set to true (which is only S.R.CS.Unsafe). Artifacts_Linux_Release is the only one publishing all artifacts for all assemblies.
  • In Artifacts_Linux_Release, there are artifacts being published for test projects.

Before vs After.
image

@carlossanlop
Copy link
Member Author

carlossanlop commented Nov 14, 2024

Bug investigation:


There's a duplicate "Publish logs" step.

Seems to be expected. They are two different tasks, but the name happens to be the same.


Artifacts_WindowsNT_Release and Artifacts_WindowsNT_Debug are only publishing the packages of the assemblies that currently have IsPackable set to true (which is only S.R.CS.Unsafe). Artifacts_Linux_Release is the only one publishing all artifacts for all assemblies.

Expected. That's how we configured them. Only the 3rd one is meant for packing everything (it passes /p:IsPackable=true, the others don't).


In Artifacts_Linux_Release, there are artifacts being published for test projects.

Seems that the Pack target gets always executed for all projects.

@carlossanlop carlossanlop marked this pull request as ready for review November 14, 2024 23:50
@carlossanlop carlossanlop self-assigned this Nov 14, 2024
@ViktorHofer
Copy link
Member

This is uploading too much. We don't want the bin folder i.e.:

image

@carlossanlop
Copy link
Member Author

@carlossanlop
Copy link
Member Author

carlossanlop commented Nov 15, 2024

This is uploading too much. We don't want the bin folder i.e.:

@ViktorHofer I suppose there cases where we do want to upload the bin folder? For example, when we are not packing?

Here's an example of machinelearning, which only has bin and log folders: https://dev.azure.com/dnceng-public/public/_build/results?buildId=870926&view=artifacts&pathAsName=false&type=publishedArtifacts

Edit: Oh I see, machinelearning needs to publish the bin folder because it gets used in subsequent jobs, like in runtime. We don't do that here.

In that case, we have 3 different jobs in m-p: two are linux, one is windows. Only one of those 3 (a linux job) publishes packages. Do I need to disable publishing the bin folder for all 3?

@carlossanlop
Copy link
Member Author

@ViktorHofer since we are building and packing in the same job, it makes sense that both the bin and packages folders get published.

Arcade does not offer an option to choose what to copy so that can then be published. It's both bin and packages, or none:

- task: CopyFiles@2
displayName: Gather binaries for publish to artifacts
inputs:
SourceFolder: 'artifacts/bin'
Contents: '**'
TargetFolder: '$(Build.ArtifactStagingDirectory)/artifacts/bin'
- task: CopyFiles@2
displayName: Gather packages for publish to artifacts
inputs:
SourceFolder: 'artifacts/packages'
Contents: '**'
TargetFolder: '$(Build.ArtifactStagingDirectory)/artifacts/packages'
- task: PublishBuildArtifacts@1
displayName: Publish pipeline artifacts
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)/artifacts'
PublishLocation: Container
ArtifactName: ${{ coalesce(parameters.artifacts.publish.artifacts.name , 'Artifacts_$(Agent.Os)_$(_BuildConfig)') }}

My option would be to rewrite this. Do we really want that?

@carlossanlop
Copy link
Member Author

@ViktorHofer
Copy link
Member

@carlossanlop are you sure? I still see the bin folders under artifacts. We don't want or need those. The packages are enough. We don't upload the bin folders in other repos either.

@carlossanlop
Copy link
Member Author

Oh, for a moment I thought the bin folder was shoing up in the root folder. My bad.

What I did remove was the duplicate "Log" folder.

@ericstj
Copy link
Member

ericstj commented Nov 18, 2024

Looks to me like the relevant portion of the yml templates is here:

- ${{ if ne(parameters.artifacts.publish, '') }}:

@carlossanlop
Copy link
Member Author

Looks to me like the relevant portion of the yml templates is here:

- ${{ if ne(parameters.artifacts.publish, '') }}:

I already tried re-writing that code: 97879c7

But I had to revert the commit as it was not working. But let me combine it with the latest changes I made, I must have missed something.

@ViktorHofer
Copy link
Member

But I had to revert the commit as it was not working. But let me combine it with the latest changes I made, I must have missed something.

I don't think that Arcade makes this possible by default. You could contribute to Arcade's template to allow only publishing packages or add a bit of YML as most other repos do to upload the packages folder.

@carlossanlop
Copy link
Member Author

This isn't urgent and the PR needs additional changes coming from the other repo. I'll close this for the time being.

@carlossanlop carlossanlop deleted the PublicPRArtifacts branch January 14, 2025 22:51
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.

YML should upload produced packages as pipeline artifacts
3 participants