Skip to content
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

Build fails when setting skipFeatureDeployment to true #7386

Closed
1 of 9 tasks
barisbikmaz opened this issue Oct 8, 2021 · 8 comments
Closed
1 of 9 tasks

Build fails when setting skipFeatureDeployment to true #7386

barisbikmaz opened this issue Oct 8, 2021 · 8 comments
Labels
area:spfx Category: SharePoint Framework (not extensions related) status:fixed-next-drop Issue planned to be fixed in an upcoming release.
Milestone

Comments

@barisbikmaz
Copy link

barisbikmaz commented Oct 8, 2021

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

💥 SharePoint Framework

Developer environment

Windows

What browser(s) / client(s) have you tested

  • 💥 Internet Explorer
  • 💥 Microsoft Edge
  • 💥 Google Chrome
  • 💥 FireFox
  • 💥 Safari
  • mobile (iOS/iPadOS)
  • mobile (Android)
  • not applicable
  • other (enter in the "Additional environment details" area below)

Additional environment details

  • SPFx version: 1.12.1
  • Node.js version: 14.17.0

Describe the bug / error

I have a solution which I want to install tenant-wide. Therefore I have set "skipFeatureDeployment" property to "true".
When I run the command "gulp package-solution --ship" I get a warning

Admins can make this solution available to all sites immediately, but the solution also contains feature.xml elements for provisioning. Feature.xml elements are not automatically applied unless the solution is explicitly installed on a site.

which results in an npm error and causes our CI pipeline to fail.

Steps to reproduce

  1. Goto package-solution.json
  2. Set skipFeatureDeployment to "true"
  3. run "gulp package-solution --ship"

My package-solution.json

{
  "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json",
  "solution": {
    "name": "My Solution Name",
    "id": "13aa1234-5555-4455-aaaa-1a2eab3f4567",
    "iconPath": "assets/icons/app-icon.png",
    "version": "1.0.0.0",
    "includeClientSideAssets": true,
    "skipFeatureDeployment": true,
    "features": [
      {
        "title": "My cool feature",
        "description": "Deploys a command button for document libraries.",
        "id": "2b8fcbc1-5aa7-4ac7-8e5f-74378d2119fb",
        "version": "1.0.0.0",
        "assets": {
          "elementManifests": [
            "elements.xml",
            "clientsideinstance.xml"
          ]
        }
      }
    ],
    "developer": {
      ....
    }
  },
  "paths": {
    "zippedPackage": "solution/my-solution.sppkg"
  }
}

package.json

"dependencies": {
   "@microsoft/decorators": "1.12.1",
   "@microsoft/sp-core-library": "1.12.1",
   "@microsoft/sp-dialog": "1.12.1",
   "@microsoft/sp-listview-extensibility": "1.12.1",
   "@pnp/sp": "^2.9.0",
   "@types/webpack-env": "^1.16.2"
 },
 "devDependencies": {
   "@microsoft/rush-stack-compiler-3.7": "0.6.47",
   "@microsoft/sp-build-web": "1.12.1",
   "@microsoft/sp-module-interfaces": "1.12.1",
   "@microsoft/sp-tslint-rules": "1.12.1",
   "@microsoft/sp-webpart-workbench": "1.12.1",
   "@types/chai": "4.2.22",
   "@types/jest": "24.0.24",
   "@types/mocha": "9.0.0",
   "@voitanos/jest-preset-spfx-react16": "^1.5.0",
   "ajv": "~8.6.3",
   "gulp": "^4.0.2",
   "jest": "24.9.0",
   "ts-jest": "24.2.0",
   "typescript": "3.7.7"
 }

Expected behavior

Setting skipFeatureDeployment property to true should not fail build.

@barisbikmaz barisbikmaz added the type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs. label Oct 8, 2021
@VesaJuvonen VesaJuvonen added the area:spfx Category: SharePoint Framework (not extensions related) label Oct 8, 2021
@patmill
Copy link
Contributor

patmill commented Oct 8, 2021

Right, so the way you have this set up currently is that you have an extension that has feature XML (your elements.xml file). This basically says "add this element to a site when the app is deployed to it, because the element controls registration". However, you have also said "you don't need to deploy this app to a site". The warning is pointing out the discrepancy.

@barisbikmaz
Copy link
Author

barisbikmaz commented Oct 8, 2021

@patmill Sorry I don't really get it. What can I do now to build a solution that an admin can deploy tenant-wide without an npm error?

My Reference is here : tenant-scoped-deployment and the config looks the same as mine.

image

@AJIXuMuK
Copy link
Collaborator

AJIXuMuK commented Oct 8, 2021

Hi @barisbikmaz - do you have some custom CI pipeline that fails if there are warnings in the console?

We do use warning to provide some important information. In your scenario, as @patmill mentioned, we inform that you have Feature Framework elements in tenant-wide solution.

@AJIXuMuK AJIXuMuK added Needs: Author Feedback Awaiting response from the original poster of the issue. Marked as stale if no activity for 7 days. and removed type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs. labels Oct 8, 2021
@barisbikmaz
Copy link
Author

@AJIXuMuK Yes my CI pipeline fails because of this warning. As you can see in my previous comment npm sends an error code 1.

At the moment I have added a build supression to gulpfile.js:

  • build.addSuppression(/Admins can make this solution available to all sites immediately.*/);

@ghost ghost added Needs: Attention 👋 Original poster responded to request for feedback, awaiting attention from Microsoft / community. and removed Needs: Author Feedback Awaiting response from the original poster of the issue. Marked as stale if no activity for 7 days. labels Oct 8, 2021
@barisbikmaz
Copy link
Author

barisbikmaz commented Oct 8, 2021

@AJIXuMuK Sorry my build does not fail although it says that it has failed. 🤔

image

@AJIXuMuK
Copy link
Collaborator

@barisbikmaz - seems like the pipeline doesn't like warnings.

We'll be working to write warning in more specific situation (when there is a tenant-wide deployment, elements.xml file and web parts only).
Probably, it'll make things better for you.

But I would also check settings to disable failing on warning output.

@patmill patmill added the status:fixed-next-drop Issue planned to be fixed in an upcoming release. label Oct 12, 2021
@patmill patmill added this to the 1.14 milestone Oct 12, 2021
@patmill patmill removed the Needs: Attention 👋 Original poster responded to request for feedback, awaiting attention from Microsoft / community. label Oct 25, 2021
@AJIXuMuK
Copy link
Collaborator

@barisbikmaz - the promised changes were included in the 1.14 beta.

@ghost
Copy link

ghost commented Jan 6, 2022

Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues

@SharePoint SharePoint locked as resolved and limited conversation to collaborators Jan 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area:spfx Category: SharePoint Framework (not extensions related) status:fixed-next-drop Issue planned to be fixed in an upcoming release.
Projects
None yet
Development

No branches or pull requests

4 participants