Commit Graph

23 Commits

Author SHA1 Message Date
Julien ff5fe13fe2
Fix incorrect caching of git auth method in error cases ()
urlAuthParser.Parse caches auth methods. To avoid caching the auth
method when running into an error, we first checked that the auth method
is not nil. However we ran into a classic Go issue where a nil value of
a concrete type is assigned to a variable of an interface type, making 
it not equal to nil.

https://go.dev/doc/faq#nil_error

https://go.dev/play/p/AOSdCWd3XC1

Fixes https://github.com/pulumi/pulumi/issues/16637

---------

Co-authored-by: Thomas Gummerer <t.gummerer@gmail.com>
2024-07-16 14:53:32 +00:00
Germán Lena 956428f690
Update deployment settings git configuration to support directories that are not a git repo ()
Change how the deployment settings configures git repos to support
directories that are not git repositories

Fix https://github.com/pulumi/pulumi-service/issues/20675

---------

Co-authored-by: Levi Blackstone <levi@pulumi.com>
2024-07-11 14:14:18 +00:00
Germán Lena a7d5e238b8
New deployment settings wizards and environment variables management comands ()
- Turns `deployment settings init` command a wizard
- Adds new `deployment settings env` command to manage env variables
(including secrets encryption)
- Adds new `deployment settings set` command to configure individual
settings (including secrets encryption)

https://asciinema.org/a/QhuWHAvkmeAmVJkYqkCP0P6wb

Fix https://github.com/pulumi/pulumi-service/issues/20567
Fix https://github.com/pulumi/pulumi-service/issues/20576
2024-07-03 20:24:26 +00:00
Bryce Lampe 9a8a677a39 [cli/new] Support SSH-style Git URLs
This adds support for SSH-style Git URLs, enabling folks to use
private repos for their templates.

For instance,

    $ pulumi new git@github.com:acmecorp/templates/website

will now work as intended.

The `ssh_config` library handles finding the relevant SSH key for the
given host.

If the SSH key is protected by a password, the user will be prompted to
supply the password on-demand. (It is memoized to avoid asking multiple
times, as the template workflow requires using it more than once.) To
avoid prompting, the `PULUMI_GITSSH_PASSPHRASE` env var can be set.

Fixes  and .
2023-08-02 09:29:34 -07:00
Pat Gavlin 88290d8cb2 [cli] Add project root update metadata
These changes add the path to the current project relative to the root
of the VCS repository to update metadata. If VCS info is not available,
this metadata is not added.

Part of https://github.com/pulumi/home/issues/2946.
2023-07-17 17:06:41 -07:00
Fraser Waters ad8e095c74 sdk/go/common/util cleanup
Most of util, skips cmdutil and rpcutil
2023-03-10 08:49:00 +00:00
Justin Van Patten 487d1a03b8 cli: Fix issue with pulumi new and unstaged files 2022-10-27 22:39:31 +01:00
Fraser Waters 55d66c8bfb Report unstaged changes from GitCloneOrPull 2022-10-24 10:42:26 +01:00
杨成锴 7b09ad142a chore: Update doc comments, coding style, fix lint
* about error string: error string should not be capitalized or end with punctuation mark
* apply suggestions from code review
* lint: fix format error and simplify the code

Co-authored-by: Fraser Waters <frassle@gmail.com>
Co-authored-by: Aaron Friel <mayreply@aaronfriel.com>
2022-10-13 13:50:49 -07:00
Fraser Waters 3b97bf5788 Fix cloning from ADO repos
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.
2022-10-07 08:27:46 +01:00
Kyle Dixler 7f38f05f0f
Merge remote-tracking branch 'origin/master' into dixler/6360/azure-devops 2022-09-23 10:06:29 -07:00
Kyle Dixler d14b4808be
removed url parsing 2022-09-23 07:19:05 -07:00
Kyle Dixler 3bda0057f4
initial version 2022-09-19 15:06:07 -07:00
avlllo 966508f6cd
Add token auth to git go module ()
* Add username/password support into git urls

* Add auth parser

* Add pending changelog

Co-authored-by: user <a.v.olshanskiy@tinkoff.ru>
Co-authored-by: Ian Wahbe <ian@wahbe.com>
2022-09-13 19:24:22 +02:00
Bryce Lampe 3d09e4e7c1
fix: handle .net and other domains in VCS detection () 2022-08-23 21:21:03 -07:00
Fraser Waters c9094f2ceb
Update go-git to v5 ()
* Update go-git to v5

* Add to CHANGELOG
2022-08-09 12:46:28 +01:00
Robbie McKinstry d706e9deb2
[sdk/go] Support nested git project paths ()
Support nested git project paths
2022-06-12 16:37:10 -04:00
Ian Wahbe 7222e5570a
[cli] check main after master ()
* Allow specifying a branch with url#branch

* Probe for master and main

* Update CHANGELOG

* Fix linter errors

* Remove unnecessary feature

* Fix lint

* Update changelog to reflect new limited scope.

We only talk about the master -> main probing, because that is all the
PR does. It used to duplicate another feature.
2021-11-19 13:49:59 -08:00
svangordon-fruit 29fa23d6d9
Accept git remotes with periods in hostname ()
Fix `cloudSourceControlSSHRegex` so that it will match git remotes with periods or hyphens in the hostname. However, `azureSourceControlSSHRegex` _does_ match hostnames with a period. As a result, `TryGetVCSInfo` will treat these sorts of remotes as Azure source control remotes and drop the first group. This causes updates to have an incorrect `"vcs.kind"` field. For example, an update with a Git remote of `github.foo.acme.com` will have a `"vcs.kind"` field of `foo.acme.com`. This occurs if a user is using a self-hosted GH enterprise instance.
2021-08-01 10:47:44 -07:00
pulumi-bot 73a66f48ea [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
jetvova b4c2a3521c
Fixed issue (Missing Pulumi console tags on Windows) ()
Co-authored-by: Paul Stack <public@paulstack.co.uk>
2020-09-25 15:04:18 +01:00
CyrusNajmabadi 66bd3f4aa8
Breaking changes due to Feature 2.0 work
* Make `async:true` the default for `invoke` calls ()

* Switch away from native grpc impl. ()

* Remove usage of the 'deasync' library from @pulumi/pulumi. ()

* Only retry as long as we get unavailable back.  Anything else continues. ()

* Handle all errors for now. ()


* Do not assume --yes was present when using pulumi in non-interactive mode ()

* Upgrade all paths for sdk and pkg to v2

* Backport C# invoke classes and other recent gen changes ()

Adjust C# generation

* Replace IDeployment with a sealed class ()

Replace IDeployment with a sealed class

* .NET: default to args subtype rather than Args.Empty ()

* Adding system namespace for Dotnet code gen

This is required for using Obsolute attributes for deprecations

```
Iam/InstanceProfile.cs(142,10): error CS0246: The type or namespace name 'ObsoleteAttribute' could not be found (are you missing a using directive or an assembly reference?) [/Users/stack72/code/go/src/github.com/pulumi/pulumi-aws/sdk/dotnet/Pulumi.Aws.csproj]
Iam/InstanceProfile.cs(142,10): error CS0246: The type or namespace name 'Obsolete' could not be found (are you missing a using directive or an assembly reference?) [/Users/stack72/code/go/src/github.com/pulumi/pulumi-aws/sdk/dotnet/Pulumi.Aws.csproj]
```

* Fix the nullability of config type properties in C# codegen ()
2020-04-14 09:30:25 +01:00
evanboyle 0e9c5989bb move pkg/util/gitutil -> sdk/go/common/util/gitutil 2020-03-18 15:52:09 -07:00