Skip to content

Conversation

jshigetomi
Copy link
Contributor

@jshigetomi jshigetomi commented Oct 4, 2024

PR Summary

Fix #30

This pull request includes several updates to configuration files, build scripts, and pipeline definitions to enhance the build and release process for the ThreadJob module. The most important changes include adding new configuration files, updating build scripts to support a proxy module, and modifying pipeline definitions for automated builds and releases.

Configuration Updates:

  • Added .config/tsaoptions.json to configure instance URL, project name, area path, codebase name, notification aliases, and tools.
  • Added global.json to specify the .NET SDK version to use.

Build Script Enhancements:

  • Updated build.ps1 to support building with netstandard2.0 and added support for a proxy module. [1] [2] [3]
  • Updated buildtools.psm1 to use Microsoft.PowerShell.PSResourceGet instead of PowerShellGet and added logic to publish both the official and proxy modules. [1] [2]

Pipeline Definitions:

  • Added .pipelines/threadjobs-official.yml to define a pipeline for building and releasing the ThreadJob module, including stages for building, manual validation, and publishing to the PowerShell Gallery.

Dependency Management:

  • Added .github/dependabot.yml to configure Dependabot for managing dependencies in the project.
  • Updated nuget.config to use the PowerShellCore public packages feed.

Module Versioning:

  • Updated Microsoft.PowerShell.ThreadJob.psd1 to increment the module version from 2.1.1 to 2.2.0.

Set up CI with Start Right

made pipeline file based on Jim's texteditor

now building with net8.0

added tsa json

added dependabot

fixed yml to sign code.

revert dotnet back to 8.0

revert back to privateassets for PowerShellStandardLibrary

revert back to privateassets for PowerShellStandardLibrary

fixed build.psm1 and yml to fix code signing error

Deleted Microsoft.PowerShell.Threadjob.csproj

Revert "Deleted Microsoft.PowerShell.Threadjob.csproj"

This reverts commit cdc5061.

Deleted Microsoft.PowerShell.ThreadJob.csproj

debugging build...

Merged PR 32351: Revert "Deleted Microsoft.PowerShell.ThreadJob.csproj"

Revert "Deleted Microsoft.PowerShell.ThreadJob.csproj"

Reverted commit `d1f649d9`.

debugging build

Updated nuget.config

fixing powershellget import with netlock

Deleted Microsoft.PowerShell.Threadjob.csproj

trying to install PSResourceGet

Trying to import PSReousrceGet

updated yml

updated yml and moved install of psresourceget to build

updated yml fixed Install-Module line

updated yml fixed version to MinimumVersion

added settings for linux

testing csproj powershel.sdk for unix

testing csproj powershel.sdk for unix

add dll in a separate folder. Fixed issues with relfection.

removed the local dll reference and the unix condition.

conditionally added SMA.Security

added conditional fomatting

using reflection for Security Policy removed dependency to SMA target framework netstandard2.0

updated pipeline with new build command netstandard2.0

fixed an issue with reflection. Abstracted the assembly to a method. Need to figure out a way to not run a process every time and save the SMA dll path.

Added DeployBoxProducts release pipeline update

edits to deploybox pipeline

edits to release pipeline

moved manual validation to a separate stage

removed nuget task and changed to PublishExtension@5 task

Updated threadjobs-official.yml removed download

Updated threadjobs-official.yml fixed dependsOn

changed method of grabbing location of SMA

Updated versions to 3.0.0.
Added proxy module and edited build scripts to publish both.

replaced periods with _ in stage name

removed spaces from stage name

added two separate boolean parameters for proxy and official in the onebranch yaml

fixed error in parameters

removed spaces from stage name

added import threadjob for psd1 required module

Added test module manifest to pipeline

changed import module from dll to entire mdoule

Install-Module instead of import

Copied the Microsoft.PowerShell.ThreadJob module to env:PSModule path

fixed signing. added archive for ThreadJob

Trying to add tfx

fixed indentation

Revert "fixed signing. added archive for ThreadJob"

This reverts commit c3ec125.

trying nugetcommand

Trying Publish-PSResource

trying task: powershell@2

fixed signing again. git revert error

changed gallery api to 2. added verbose messages to release

added error actions for release pwsh script commands

trying to add dotnet sdk

dotnet version 8.x

added pwsh true

changed os to linux

added sudo

force install psresourceget and Register-PSRepositroy -Default instead of -Name PSGallery

fixed official release to Default and removed source location

removed PSGallery registration

added variable group for api key

trying to debug variable group

mapping from env

trying version

trying package.version

moved version variable to job scope and added build as dependson in release

added download current

trying templateContext to pass nupkg artifact to release stage

removed download:current's

removed publish task. trying to find pukg

trying to find nupkg

just checking pipeline.workspace

found the nupkgs

uploading morudle folder and not the jupkg because probably -NupkgPath isn't available yet

outputtig GalleryPAT for validation

gallerypat output

trying runtime expression

moved variable group to stage variable

should work now

added var group as a job variable

added name value for variable apikey

fixed indentation issue with stage variables

switch version order

removed - in group

trying to output env

trying to add it as a stage variable

got rid of ob release environment

moved everything to stage vars. left group only in job vars

removed Gallery[PAT] installing Microsoft.PowerShell.ThreadJob to machine before publishing

added verbose statements and copy-item verbose and test-module manifest for threadjob.psd1

PSModulePath separator is : in linux ; in windows.

Changed version numbers
Copy link
Member

@daxian-dbw daxian-dbw left a comment

Choose a reason for hiding this comment

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

Share my comments early. I will review the Microsoft.PowerShell.ThreadJob.cs tomorrow.


private void SetJobState(JobState jobState, Exception reason, bool disposeRunspace = false)
{
base.SetJobState(jobState, reason);
Copy link
Member

Choose a reason for hiding this comment

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

This is a bug in the PowerShellStandard.Library package. I have reported this to Patrick, who is the owner of that package. He will look into it and release a new version of the package with the fix. We need to delay the release of ThreadJob till that fix is in.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This bug hasn't been fixed yet. However, I wrote up a workaround using reflection. I will wait to release this until we have to.

@daxian-dbw
Copy link
Member

There is test available at https://github.com/PowerShell/ThreadJob/tree/master/test, but there is no test run for this PR. Did you run test privately to verify the changes? Are you going to setup CIs for this repo?

@sdwheeler
Copy link

@jshigetomi @daxian-dbw if the module is being renamed, shouldn't the PSD1 and PSM1 files be renamed?

@jshigetomi
Copy link
Contributor Author

There is test available at https://github.com/PowerShell/ThreadJob/tree/master/test, but there is no test run for this PR. Did you run test privately to verify the changes? Are you going to setup CIs for this repo?

Yes I run the tests locally to verify all changes. Yes I plan to setup CI I think that would be a great idea

@daxian-dbw
Copy link
Member

@sdwheeler There are 2 .psd1 files, one for the ThreadJob module (a proxy module after this change) and one for the M.P.ThreadJob. The former one is under src/ThreadJob and the latter is under 'src'.

@daxian-dbw
Copy link
Member

Yes I run the tests locally to verify all changes.

That's great to know. Did you run it on Linux? Given it's for all platforms, we should run tests at least on Linux too.

@jshigetomi
Copy link
Contributor Author

Yes I run the tests locally to verify all changes.

That's great to know. Did you run it on Linux? Given it's for all platforms, we should run tests at least on Linux too.

I haven't run it on Linux. I will start doing that locally until I make the CI

@jshigetomi
Copy link
Contributor Author

jshigetomi commented Feb 20, 2025

@daxian-dbw Latest changes were tested on linux and windows. Some tests needed to be tweaked for Linux

@jshigetomi
Copy link
Contributor Author

@daxian-dbw Applied recent suggestions and all CI on Linux and Windows

@daxian-dbw daxian-dbw merged commit 21d19c8 into PowerShell:master Feb 24, 2025
1 check passed
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.

Release a proxy module of ThreadJob that points to Microsoft.PowerShell.ThreadJob

4 participants