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

Add module dependency support #27

Open
TsekNet opened this issue Sep 7, 2020 · 4 comments
Open

Add module dependency support #27

TsekNet opened this issue Sep 7, 2020 · 4 comments
Labels
discussion Community input on issuedesired enhancement New feature or request

Comments

@TsekNet
Copy link
Contributor

TsekNet commented Sep 7, 2020

Description

As part of getting started with Catesta, I had to dig through the code base to find where to import the module dependencies for my PowerShell module. I found the actions_bootstrap.ps1 file, and determined that I needed to add my module imports there.

For additional context, I was not able to initially start using Catesta until I added my module imports to the actions_bootstrap.ps1 script, as my tests were failing due to missing module dependencies.

I noticed a note in the build.ps1 script about dependency installation not being included, but was not able to find further documentation on that comment.

See this failed action for an example of the error I ran into, and this commit for how I resolved this issue.

Describe the solution you'd like

Ideally, during setup, Catesta would have an additional prompt that asks you which modules you would like to install as dependencies. This should add the required modules to the module manifest and the appropriate workflow script.

Describe any alternatives you've considered

Alternatively, update/add documentation on how to avoid this issue for users getting started with Catesta.

Additional context

Example broken action run: https://github.com/TsekNet/TsekProfile/runs/1078982174?check_suite_focus=true
Fixed issue in my repo: TsekNet/TsekProfile@2257337

@TsekNet TsekNet added the enhancement New feature or request label Sep 7, 2020
@techthoughts2 techthoughts2 self-assigned this Sep 7, 2020
@techthoughts2
Copy link
Owner

For now, I've elected to address this via additional documentation.

I recognize that overall, module dependency is something that could stand to be improved.

I have not settled on something beyond ensuring that required modules are added to the bootstrap file. Solutions like PSDepend or PSRequire seem overly clunky for solving this which is what other module generator solutions tend to lean on.

I am open to discussion on ideas for longer term improvements.

@TsekNet
Copy link
Contributor Author

TsekNet commented Sep 9, 2020

Did a quick PoC of using PSDepend with Catesta this morning. I haven't used PSDepend before, but I don't see it being a clunky solution. I found PSDepend to be extensible and simple. Open to discussing why/if there's any hesitance to use PSDepend.

Artifacts:

@TsekNet
Copy link
Contributor Author

TsekNet commented Sep 10, 2020

Adding that what was missing from the solution above was local dependency support. I've added this in my latest commit, linked below:

TsekNet/TsekProfile@d3762dc#diff-e7215d569c39029991758de0706d2dcc (starting on like 269)

@techthoughts2 techthoughts2 reopened this Sep 12, 2020
@techthoughts2 techthoughts2 added the discussion Community input on issuedesired label Sep 12, 2020
@TsekNet
Copy link
Contributor Author

TsekNet commented Oct 7, 2020

For GitHub actions specifically, seeing this an option: https://github.com/marketplace/actions/powershell-module-cache

@techthoughts2 techthoughts2 removed their assignment May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Community input on issuedesired enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants