GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Architect#scheduleBuilder or context.scheduleBuilder results in incorrect target on context · Issue #19905 · angular/angular-cli

Architect#scheduleBuilder or context.scheduleBuilder results in incorrect target on context #19905

New issue
Copy link
New issue
Copy link
Open
Open
Architect#scheduleBuilder or context.scheduleBuilder results in incorrect target on context#19905
Copy link
Labels
area: @angular-devkit/architectfreq1: lowOnly reported by a handful of users who observe it rarelyOnly reported by a handful of users who observe it rarelyseverity3: brokentype: bug/fix
Milestone
Backlog

Description

@bgotink
bgotink
opened on Jan 29, 2021
Issue body actions

🐞 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, 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.

console.log(context.target);
// logs {project: undefined, target: undefined, configuration: undefined}
// but type is {project: string, target: string, configuration?: string} | undefined

🔬 Minimal Reproduction

Run yarn bazel test //packages/angular_devkit/architect:architect_test with the following patch:

diff --git a/packages/angular_devkit/architect/src/index_spec.ts b/packages/angular_devkit/architect/src/index_spec.ts
index 57d76c5a6..bbd59b3fc 100644
--- a/packages/angular_devkit/architect/src/index_spec.ts
+++ b/packages/angular_devkit/architect/src/index_spec.ts
@@ -36,10 +36,12 @@ describe('architect', () => {
 
     options = {};
     called = 0;
-    testArchitectHost.addBuilder('package:test', createBuilder(async o => {
+    testArchitectHost.addBuilder('package:test', createBuilder(async (o, ctx) => {
       called++;
       options = o;
 
+      expect(ctx.target != null && ctx.target.target == null).toBe(false);
+
       return new Promise<BuilderOutput>(resolve => {
         setTimeout(() => resolve({ success: true }), 10);
       });

🔥 Exception or Error


Failures:
1) architect runs builders parallel
  Message:
    Expected true to be false.
  Stack:
    Error: Expected true to be false.
        at 
        at packages/angular_devkit/architect/src/index_spec.ts:43:63
        at onInput (packages/angular_devkit/architect/src/create-builder.ts:201:20)
        at SafeSubscriber._next (packages/angular_devkit/architect/src/create-builder.ts:87:17)

🌍 Your Environment

Master branch on this repo

Anything else relevant?

Activity

  1. alan-agius4
    added
    area: @angular-devkit/architect
    freq1: lowOnly reported by a handful of users who observe it rarelyOnly reported by a handful of users who observe it rarely
    severity3: broken
    type: bug/fix
    on Feb 1, 2021
  2. ngbot
    modified the milestone: Backlog on Feb 1, 2021
  3. bgotink
    added a commit that references this issue on Feb 2, 2021

    {fix} work around angular/angular-cli#19905

    2f290d5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: @angular-devkit/architectfreq1: lowOnly reported by a handful of users who observe it rarelyOnly reported by a handful of users who observe it rarelyseverity3: brokentype: bug/fix

    Type

    No type

    Projects

    No projects

      Milestone

      • BacklogNo due date

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.