-   Notifications  You must be signed in to change notification settings 
- Fork 217
Insert Expression and Field types into GlobalOptions and inheriting types #1171
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
   Merged  
     Merged  
 Changes from all commits
 Commits 
  Show all changes 
  25 commits   Select commit Hold shift + click to select a range 
 3ad62e2  wip: expr type 
  Berlioz 5f8cccb  npm run prettier 
  Berlioz b7f879b  trigger fields 
  Berlioz 48f2d9a  more detailed expr type 
  Berlioz bf6c420  Merge remote-tracking branch 'origin' into vf_expr_type 
  Berlioz b6d592e  Merge remote-tracking branch 'origin' into vf_expr_type 
  Berlioz e274fc7  wip: in-progress commit for providing params and param-valued fields … 
  Berlioz c00c2f7  wip: regexp validation 
  Berlioz 66cffc9  resourceInput selectors 
  Berlioz 156a21d  remove extraneous changes to triggerannotation which is no longer in use 
  Berlioz 1089043  wip class-ification of expression type 
  Berlioz b0a9063  wip: split wire/manifest spec 
  Berlioz 8942e5c  WIP: classification of Expressions 
  Berlioz 3778deb  WIP: add value() semantics to params and expressions 
  Berlioz 6379cc3  type system changes to conform with go/cf3-params-detailed 
  Berlioz 27937eb  style fixes per review 
  Berlioz df07167  removed shotgun testing change 
  Berlioz aaf3dda  changes per review, most substantially making param inputs an optiona… 
  Berlioz d4bf770  merge experssions.ts with params.ts 
  Berlioz a114386  remove empty expressions.ts 
  Berlioz 8c3447b  Merge remote-tracking branch 'origin' into vf_expr_type 
  Berlioz f63c895  nits per pr 
  Berlioz 2c67693  typo 
  Berlioz 251aa43  format fix 
  Berlioz 47e2330  timezone -> timeZone, and fix SelectInput 
  Berlioz File filter
Filter by extension
Conversations
 Failed to load comments.  
    Loading  
 Jump to
  Jump to file  
  Failed to load files.  
    Loading  
 Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
  Oops, something went wrong.  
    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   
        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   
        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   
     | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| import { stackToWire, ManifestStack } from '../../src/runtime/manifest'; | ||
| import { expect } from 'chai'; | ||
| import * as params from '../../src/v2/params'; | ||
|  | ||
| describe('stackToWire', () => { | ||
| afterEach(() => { | ||
| params.clearParams(); | ||
| }); | ||
|  | ||
| it('converts Expression types in endpoint options to CEL', () => { | ||
| const intParam = params.defineInt('foo', { default: 11 }); | ||
| const stringParam = params.defineString('bar', { | ||
| default: 'America/Los_Angeles', | ||
| }); | ||
|  | ||
| const stack: ManifestStack = { | ||
| endpoints: { | ||
| v2http: { | ||
| platform: 'gcfv2', | ||
| entryPoint: 'v2http', | ||
| labels: {}, | ||
| httpsTrigger: {}, | ||
| concurrency: intParam, | ||
| maxInstances: intParam.equals(24).then(-1, 1), | ||
|   taeold marked this conversation as resolved. Show resolved Hide resolved | ||
| }, | ||
| v2schedule: { | ||
| platform: 'gcfv2', | ||
| entryPoint: 'v2callable', | ||
| labels: {}, | ||
| scheduleTrigger: { | ||
| schedule: stringParam | ||
| .equals('America/Mexico_City') | ||
| .then('mexico', 'usa'), | ||
| timeZone: stringParam, | ||
| }, | ||
| }, | ||
| }, | ||
| requiredAPIs: [], | ||
| specVersion: 'v1alpha1', | ||
| }; | ||
| const expected = { | ||
| endpoints: { | ||
| v2http: { | ||
| platform: 'gcfv2', | ||
| entryPoint: 'v2http', | ||
| labels: {}, | ||
| httpsTrigger: {}, | ||
| concurrency: '{{ params.foo }}', | ||
| maxInstances: '{{ params.foo == 24 ? -1 : 1 }}', | ||
| }, | ||
| v2schedule: { | ||
| platform: 'gcfv2', | ||
| entryPoint: 'v2callable', | ||
| labels: {}, | ||
| scheduleTrigger: { | ||
| schedule: | ||
| '{{ params.bar == "America/Mexico_City" ? "mexico" : "usa" }}', | ||
| timeZone: '{{ params.bar }}', | ||
| }, | ||
| }, | ||
| }, | ||
| requiredAPIs: [], | ||
| specVersion: 'v1alpha1', | ||
| }; | ||
| expect(stackToWire(stack)).to.deep.equal(expected); | ||
| }); | ||
| }); | ||
  Oops, something went wrong.  
  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.    
 
Uh oh!
There was an error while loading. Please reload this page.