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

Assign device group to pipeline stage #3229

Merged

Conversation

Steve-Mcl
Copy link
Contributor

@Steve-Mcl Steve-Mcl commented Dec 18, 2023

Description

General

Add support for setting a Device Group as the target of a pipeline execution

Adds through table PipelineStageDeviceGroups

image

Add unit tests

Pipelines API
  Create Pipeline Stage
    With device group
      ✔ Should create a pipeline stage
      Validates that the first stage cannot be a device group
        ✔ Rejects a pipeline stage if the device group is applied to the 1st stage
      Validates that a stage cannot be added after device group
        ✔ Rejects a pipeline stage if the device group is added where a device group already exists
    With both device and device group
      ✔ Rejects the request gracefully
    With both instance and device group
      ✔ Rejects the request gracefully
    With neither device, instance or device group
      ✔ Fails gracefully with a clear error
  Get Pipeline Stage
    ✔ Should return a single pipeline stage with a device group
  Update Pipeline Stage
    With a new name
      ✔ Should update a single pipeline stage with a new name (44ms)
    With a new device group
      ✔ Should unassign the old device group and assign the new one (62ms)
      ✔ Should require the device group to be part of the same application
      ✔ Should not be allowed to replace 1st stage
      ✔ Should not be allowed set a center stage as a device group (86ms)
  Delete Pipeline Stage
    ✔ should destroy the pipeline stage, but not touch the assigned device group
  Deploy Pipeline Stage
    For instance=>device group
      Copies the existing instance snapshot to the next stages device group
  List Application Pipelines
    ✔ should list all the pipelines within an application including stages, instances, devices and device groups

add e2e tests

FlowForge - Application - DevOps Pipelines
    ✔ cannot select device group in the first stage of a pipeline
    ✔ cannot add any more stages after a device group

Related Issue(s)

#2989

Checklist

  • I have read the contribution guidelines
  • Suitable unit/system level tests have been added and they pass
  • Documentation has been updated
    • Upgrade instructions
    • Configuration details
    • Concepts
  • Changes flowforge.yml?
    • Issue/PR raised on FlowFuse/helm to update ConfigMap Template
    • Issue/PR raised on FlowFuse/CloudProject to update values for Staging/Production

Labels

  • Backport needed? -> add the backport label
  • Includes a DB migration? -> add the area:migration label

@Steve-Mcl Steve-Mcl linked an issue Dec 18, 2023 that may be closed by this pull request
Copy link

codecov bot commented Dec 18, 2023

Codecov Report

Attention: 185 lines in your changes are missing coverage. Please review.

Comparison is base (97c3ed0) 40.52% compared to head (ef99669) 40.71%.

Files Patch % Lines
frontend/src/pages/application/Pipelines.vue 0.00% 41 Missing ⚠️
...ntend/src/pages/application/PipelineStage/form.vue 0.00% 37 Missing ⚠️
frontend/src/components/pipelines/PipelineRow.vue 0.00% 20 Missing ⚠️
forge/ee/db/controllers/Pipeline.js 84.90% 16 Missing ⚠️
frontend/src/pages/application/DeviceGroups.vue 0.00% 12 Missing ⚠️
frontend/src/store/account.js 0.00% 11 Missing ⚠️
frontend/src/components/pipelines/Stage.vue 0.00% 8 Missing ⚠️
frontend/src/pages/application/index.vue 0.00% 8 Missing ⚠️
...end/src/components/pipelines/DeployStageDialog.vue 0.00% 7 Missing ⚠️
forge/ee/routes/pipeline/index.js 91.48% 4 Missing ⚠️
... and 8 more
Additional details and impacted files
@@                      Coverage Diff                       @@
##           2997-device-group-frontend    #3229      +/-   ##
==============================================================
+ Coverage                       40.52%   40.71%   +0.18%     
==============================================================
  Files                             597      598       +1     
  Lines                           22063    22342     +279     
  Branches                         5301     5387      +86     
==============================================================
+ Hits                             8941     9096     +155     
- Misses                          13122    13246     +124     
Flag Coverage Δ
backend 77.38% <90.37%> (+0.23%) ⬆️
frontend 2.03% <2.66%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Pezmc
Copy link
Contributor

Pezmc commented Dec 19, 2023

I've done a first pass here to get an overall idea, but need to go through again tomorrow with fresh eyes

@Pezmc
Copy link
Contributor

Pezmc commented Dec 20, 2023

I've been through this again and nothing stood out, I'm still not feeling 100% about it yet, perhaps just because of the number of changes, but let's not block this any longer.

@knolleary knolleary merged commit 5b11555 into 2997-device-group-frontend Dec 20, 2023
10 checks passed
@knolleary knolleary deleted the 2989-assign-device-group-to-pipeline-stage branch December 20, 2023 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Possibility to assign Devices Groups to a DevOps Pipeline
4 participants