-
Notifications
You must be signed in to change notification settings - Fork 281
Allowing env variables to be set without forcing VSTS_TASKVARIABLE_ prefix #650
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
Open
jeffw16
wants to merge
194
commits into
microsoft:master
Choose a base branch
from
jeffw16:patch-1
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ent-version Add TFS 2017 Update 3 agent version.
Deep Dive on Building Custom Build or Deploy Tasks
* Add task.json schema file * Allow any "connectedService:" type of input * Added the "id" field
…cefiles Allow multiple resource files
Properly escape property value to handle non string types
* Error on multiline secret * v2.3.0
Added: - Groups: visibleRule - DataSourceBindings: endpointUrl - DataSourceBindings: resultSelector
In fact the handling of these properties already allows for them to be undefined/null. But the annotations didn't indicate this. Since the entire options object was optional, having a couple properties on it *not* optional makes it hard to start supplying *any* options since the user must figure out what values to supply for these two properties to get equivalent behavior, in order to set some *other* option on the object.
While it doesn't make any sense, the typings for `process.env` is: ```ts interface ProcessEnv { [key: string]: string | undefined; } ``` So assigning `process.env` to `IExecSyncOptions.env` in typescript with all typings turned on produces compiler errors (at least when strict null checking is applied). Without this simple typings adjustment, the following workaround in user code is required: ```ts function GetFilteredEnv() { const result = {}; const block = process.env; for (const key in block) { if (block.hasOwnProperty(key)) { const value = block[key]; if (value !== undefined) { result[key] = value; } } } return result; } let options: IExecSyncOptions = { env: GetFilteredEnv() }; ``` But with this change it's as simple as: ```ts let options: IExecSyncOptions = { env: process.env }; ``` Which ironically is already what is done *within* this repo, but isn't a problem because the node typings aren't imported so `process.env` is typed as `any`.
Co-authored-by: Tommy Petty <jopetty@microsoft.comwq>
Adding execution options on the pre-job stage.
The previous code example had `tr.exec()` on line 8. However, it should be `atool.exec()`.
* Added shell property to IExecOptions Added shell property to IExecOptions to allow this property to be specified in pipelines tasks code. This option allows to handle variables in command the way it's needed. * Incremented versions
…rosoft#638) * Permit getDelimitedInput to split on either a string or a Regexp * Add test for splitting on regexp * Add missing argument * Remove extra arg Co-authored-by: Morgan Rodgers <morgan.rodgers@preventiongenetics.com>
* Wrapped tool path with quotes for running inside shell * Refactored toolrunner.ts * Increased version * Updated package-lock.json * Moved RegExp to separate variable * Moved toolPath wrapping to separate method * Revert "Updated package-lock.json" This reverts commit ad943d1. * Fixed package-lock.json * Added exec and execSync tests * Improved arguments handling for inside shell execution * Added tests and moved them to separate section. * Fixed Linux tests * Fixed quotes handling test * Fixed tests to support macOS * Minor code cleanup. * Made cmdSpecialChars constant readonly * Minor refactoring * Refactored arguments unwrapping * Removed redundant import. * Changes in accordance with review points * Refactored in accordance with review points * Fixed JSDocs
Any update on whether this could be integrated into the library please? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'm currently developing an internal Microsoft ADO task that takes in an output variable from another task. It would be very helpful to be able to insert an output variable within the testing framework as well.