Title: Architect#scheduleBuilder or context.scheduleBuilder results in incorrect target on context · Issue #19905 · angular/angular-cli · GitHub
Open Graph Title: Architect#scheduleBuilder or context.scheduleBuilder results in incorrect target on context · Issue #19905 · angular/angular-cli
X Title: Architect#scheduleBuilder or context.scheduleBuilder results in incorrect target on context · Issue #19905 · angular/angular-cli
Description: 🐞 Bug report Command (mark with an x) new build serve test e2e generate add update lint extract-i18n run config help version doc Is this a regression? Not that I know of Description If a builder is executed via architect.scheduleBuilder,...
Open Graph Description: 🐞 Bug report Command (mark with an x) new build serve test e2e generate add update lint extract-i18n run config help version doc Is this a regression? Not that I know of Description If a builder is...
X Description: 🐞 Bug report Command (mark with an x) new build serve test e2e generate add update lint extract-i18n run config help version doc Is this a regression? Not that I know of Description If a builder is...
Opengraph URL: https://github.com/angular/angular-cli/issues/19905
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Architect#scheduleBuilder or context.scheduleBuilder results in incorrect target on context","articleBody":"\u003c!--🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅\r\n\r\nOh hi there! 😄\r\n\r\nTo expedite issue processing please search open and closed issues before submitting a new one.\r\nExisting issues often contain information about workarounds, resolution, or progress updates.\r\n\r\n🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅--\u003e\r\n\r\n\r\n# 🐞 Bug report\r\n\r\n### Command (mark with an `x`)\r\n\u003c!-- Can you pin-point the command or commands that are effected by this bug? --\u003e\r\n\u003c!-- ✍️edit: --\u003e\r\n\r\n- [ ] new\r\n- [ ] build\r\n- [ ] serve\r\n- [ ] test\r\n- [ ] e2e\r\n- [ ] generate\r\n- [ ] add\r\n- [ ] update\r\n- [ ] lint\r\n- [ ] extract-i18n\r\n- [ ] run\r\n- [ ] config\r\n- [ ] help\r\n- [ ] version\r\n- [ ] doc\r\n\r\n\r\n### Is this a regression?\r\n\r\nNot that I know of\r\n\r\n\r\n### Description\r\n\r\nIf a builder is executed via `architect.scheduleBuilder`, that builder is passed a context that doesn't match the declared interface in typescript. The same happens when using `context.scheduleBuilder` if no target is passed via the `scheduleOptions`.\r\n\r\n```js\r\nconsole.log(context.target);\r\n// logs {project: undefined, target: undefined, configuration: undefined}\r\n// but type is {project: string, target: string, configuration?: string} | undefined\r\n```\r\n\r\n## 🔬 Minimal Reproduction\r\n\r\nRun `yarn bazel test //packages/angular_devkit/architect:architect_test` with the following patch:\r\n\r\n```patch\r\ndiff --git a/packages/angular_devkit/architect/src/index_spec.ts b/packages/angular_devkit/architect/src/index_spec.ts\r\nindex 57d76c5a6..bbd59b3fc 100644\r\n--- a/packages/angular_devkit/architect/src/index_spec.ts\r\n+++ b/packages/angular_devkit/architect/src/index_spec.ts\r\n@@ -36,10 +36,12 @@ describe('architect', () =\u003e {\r\n \r\n options = {};\r\n called = 0;\r\n- testArchitectHost.addBuilder('package:test', createBuilder(async o =\u003e {\r\n+ testArchitectHost.addBuilder('package:test', createBuilder(async (o, ctx) =\u003e {\r\n called++;\r\n options = o;\r\n \r\n+ expect(ctx.target != null \u0026\u0026 ctx.target.target == null).toBe(false);\r\n+\r\n return new Promise\u003cBuilderOutput\u003e(resolve =\u003e {\r\n setTimeout(() =\u003e resolve({ success: true }), 10);\r\n });\r\n```\r\n\r\n## 🔥 Exception or Error\r\n\r\n\u003cpre\u003e\u003ccode\u003e\r\nFailures:\r\n1) architect runs builders parallel\r\n Message:\r\n Expected true to be false.\r\n Stack:\r\n Error: Expected true to be false.\r\n at \u003cJasmine\u003e\r\n at packages/angular_devkit/architect/src/index_spec.ts:43:63\r\n at onInput (packages/angular_devkit/architect/src/create-builder.ts:201:20)\r\n at SafeSubscriber._next (packages/angular_devkit/architect/src/create-builder.ts:87:17)\r\n\u003c/code\u003e\u003c/pre\u003e\r\n\r\n\r\n## 🌍 Your Environment\r\n\r\nMaster branch on this repo\r\n\r\n**Anything else relevant?**\r\n\u003c!-- ✍️Is this a browser specific issue? If so, please specify the browser and version. --\u003e\r\n\r\n\u003c!-- ✍️Do any of these matter: operating system, IDE, package manager, HTTP server, ...? If so, please mention it below. --\u003e\r\n","author":{"url":"https://github.com/bgotink","@type":"Person","name":"bgotink"},"datePublished":"2021-01-29T23:58:07.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/19905/angular-cli/issues/19905"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:da1814fb-e988-9270-b979-f3d62c9956ab |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D288:2D90C6:52863F:704D7E:6964F5A2 |
| html-safe-nonce | 50135e6e420593da6c86d001e9f49c4c7bbbf8d881027588d57d80af6d5f2c8b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMjg4OjJEOTBDNjo1Mjg2M0Y6NzA0RDdFOjY5NjRGNUEyIiwidmlzaXRvcl9pZCI6Ijg4NTMwOTcwNDU0MDQ0ODA5MzAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | b5255cb9cb8d68786798d000cc08e0bee38e2264d962561b72b7990428c912e9 |
| hovercard-subject-tag | issue:797279444 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular-cli/19905/issue_layout |
| twitter:image | https://opengraph.githubassets.com/95d9057eb14c23f006d96e85e7afffac96e428ce0a80e7ec1bfad259d042a151/angular/angular-cli/issues/19905 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/95d9057eb14c23f006d96e85e7afffac96e428ce0a80e7ec1bfad259d042a151/angular/angular-cli/issues/19905 |
| og:image:alt | 🐞 Bug report Command (mark with an x) new build serve test e2e generate add update lint extract-i18n run config help version doc Is this a regression? Not that I know of Description If a builder is... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | bgotink |
| hostname | github.com |
| expected-hostname | github.com |
| None | 003e962bf5ca78f3f8f71db2461c6a7f9cfcbe99b480d6aeddaef78d33e9161a |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular-cli git https://github.com/angular/angular-cli.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 36891867 |
| octolytics-dimension-repository_nwo | angular/angular-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 36891867 |
| octolytics-dimension-repository_network_root_nwo | angular/angular-cli |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 21cbf6733480c5c09366f15b8dc8b6953472172a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width