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

Azure Devops support for multiple project templates under one directory #10886

Closed
meagancojocar opened this issue Sep 29, 2022 · 5 comments · Fixed by #10954
Closed

Azure Devops support for multiple project templates under one directory #10886

meagancojocar opened this issue Sep 29, 2022 · 5 comments · Fixed by #10954
Labels
kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed
Milestone

Comments

@meagancojocar
Copy link
Contributor

Hello!

  • Vote on this issue by adding a 👍 reaction
  • If you want to implement this feature, comment to let us know (we'll work with you on design, scheduling, etc.)

Issue details

From a customer:

I followed the pulumi/template github repo and made a repo in ADO that contained multiple templates under directories and when I run pulumi new it just throws "no templates" It doesn't list the templates in the repo. If I try a repo that only contains a single template that isn't nested in a directory it works as expected.

Add support for multiple templates under one directory.

Affected area/feature

pulumi new

@meagancojocar meagancojocar added kind/enhancement Improvements or new features needs-triage Needs attention from the triage team labels Sep 29, 2022
@Frassle
Copy link
Member

Frassle commented Sep 30, 2022

There's nothing ADO specific about how we read the template directory after cloning. If a single template works in ADO then multiple templates should work. Can we confirm that they had a repo layout exactly like the templates repo, that is just one level of folders and each folder containing a "Pulumi.yaml" file?

@Frassle Frassle added awaiting-feedback Blocked on input from the author and removed needs-triage Needs attention from the triage team labels Oct 4, 2022
@zbuchheit
Copy link

yes, the repo structure is like this

├───template1
│   │   Pulumi.yaml
│
├───template2
│   |   Pulumi.yaml
│
├───template3
│   |   Pulumi.yaml

@Frassle Frassle added kind/bug Some behavior is incorrect or out of spec and removed kind/enhancement Improvements or new features awaiting-feedback Blocked on input from the author labels Oct 6, 2022
@Frassle
Copy link
Member

Frassle commented Oct 6, 2022

Ok thanks, I think that must be a bug in cloning the ADO repo then. The template code should have cloned the whole repo and found those directories.

@zbuchheit
Copy link

@Frassle I believe this may be known and there was some discussion on various ways to tackle it here on this issue
#6360

@Frassle
Copy link
Member

Frassle commented Oct 6, 2022

@Frassle I believe this may be known and there was some discussion on various ways to tackle it here on this issue
#6360

That was for cloning the set of templates from a sub-path, e.g. if your repo had a "templates" folder with all the templates within it, that is not supported because we don't have a way to parse a subpath off an ADO url.

This was just that even if we cloned the whole repo we had a path bug that meant we didn't return the set of templates in the repo. This would have kind of worked before in that if you had one single template at the root of the repo it would have been picked up, but that should still work plus a layout like you commented above should also work as well with the fix in #10954.

bors bot added a commit that referenced this issue Oct 7, 2022
10954: Fix cloning from ADO repos r=Frassle a=Frassle

<!--- 
Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation.
-->

# Description

<!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. -->

Small path bug, "git clone" by default clones to a new folder based on the last part of the repo name. So running something like `pulumi new https://fraser0275@dev.azure.com/fraser0275/fraser/_git/fraser` resulted in us making a folder like /tmp/pulumi-templates-1234/fraser with all the templates in it. That last part of the path was unexpected, because when we use gogit it clones directly into the target directory we give it.

Simple fix to just add `.` to the git clone command. I also added some logging while I was about here, given it helped me work out this issue.

Fixes #10886

## Checklist

<!--- Please provide details if the checkbox below is to be left unchecked. -->
- [x] I have added tests that prove my fix is effective or that my feature works. **No but I did manually check I could download templates from azure devops.**
<!--- 
User-facing changes require a CHANGELOG entry.
-->
- [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the Pulumi Service,
then the service should honor older versions of the CLI where this change would not exist.
You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Service API version
  <!-- `@Pulumi` employees: If yes, you must submit corresponding changes in the service repo. -->


Co-authored-by: Fraser Waters <fraser@pulumi.com>
bors bot added a commit that referenced this issue Oct 7, 2022
10954: Fix cloning from ADO repos r=Frassle a=Frassle

<!--- 
Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation.
-->

# Description

<!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. -->

Small path bug, "git clone" by default clones to a new folder based on the last part of the repo name. So running something like `pulumi new https://fraser0275@dev.azure.com/fraser0275/fraser/_git/fraser` resulted in us making a folder like /tmp/pulumi-templates-1234/fraser with all the templates in it. That last part of the path was unexpected, because when we use gogit it clones directly into the target directory we give it.

Simple fix to just add `.` to the git clone command. I also added some logging while I was about here, given it helped me work out this issue.

Fixes #10886

## Checklist

<!--- Please provide details if the checkbox below is to be left unchecked. -->
- [x] I have added tests that prove my fix is effective or that my feature works. **No but I did manually check I could download templates from azure devops.**
<!--- 
User-facing changes require a CHANGELOG entry.
-->
- [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the Pulumi Service,
then the service should honor older versions of the CLI where this change would not exist.
You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Service API version
  <!-- `@Pulumi` employees: If yes, you must submit corresponding changes in the service repo. -->


Co-authored-by: Fraser Waters <fraser@pulumi.com>
@bors bors bot closed this as completed in 92c5a37 Oct 7, 2022
@pulumi-bot pulumi-bot added the resolution/fixed This issue was fixed label Oct 7, 2022
iwahbe pushed a commit that referenced this issue Oct 10, 2022
10949: Add winget and msi install checks in download cron job r=Zaid-Ajaj a=Zaid-Ajaj

<!---
Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation.
-->

# Description

<!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. -->

Fixes #10667

## Checklist

<!--- Please provide details if the checkbox below is to be left unchecked. -->
- [ ] I have added tests that prove my fix is effective or that my feature works
<!---
User-facing changes require a CHANGELOG entry.
-->
- [ ] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the Pulumi Service,
then the service should honor older versions of the CLI where this change would not exist.
You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Service API version
  <!-- `@Pulumi` employees: If yes, you must submit corresponding changes in the service repo. -->

10954: Fix cloning from ADO repos r=Frassle a=Frassle

<!---
Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation.
-->

# Description

<!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. -->

Small path bug, "git clone" by default clones to a new folder based on the last part of the repo name. So running something like `pulumi new https://fraser0275@dev.azure.com/fraser0275/fraser/_git/fraser` resulted in us making a folder like /tmp/pulumi-templates-1234/fraser with all the templates in it. That last part of the path was unexpected, because when we use gogit it clones directly into the target directory we give it.

Simple fix to just add `.` to the git clone command. I also added some logging while I was about here, given it helped me work out this issue.

Fixes #10886

## Checklist

<!--- Please provide details if the checkbox below is to be left unchecked. -->
- [x] I have added tests that prove my fix is effective or that my feature works. **No but I did manually check I could download templates from azure devops.**
<!---
User-facing changes require a CHANGELOG entry.
-->
- [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the Pulumi Service,
then the service should honor older versions of the CLI where this change would not exist.
You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Service API version
  <!-- `@Pulumi` employees: If yes, you must submit corresponding changes in the service repo. -->

Co-authored-by: Zaid Ajaj <zaid.naom@gmail.com>
Co-authored-by: Fraser Waters <fraser@pulumi.com>
@lukehoban lukehoban added this to the 0.79 milestone Oct 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants