Skip to content

Allow more than one user#431

Merged
jose-caballero merged 2 commits intomainfrom
allow_more_than_one_user
Mar 24, 2026
Merged

Allow more than one user#431
jose-caballero merged 2 commits intomainfrom
allow_more_than_one_user

Conversation

@jose-caballero
Copy link
Copy Markdown
Contributor

Description:

Special Notes:


Submitter:

Have you (where applicable):

  • Added unit tests?
  • Checked the latest commit runs on Dev?
  • Updated the example config file(s) and README?

Reviewer

Does this PR:

  • Place non-StackStorm code into the lib directory?
  • Have unit tests for the action/sensor and lib layers?
  • Have clear and obvious action parameter names and descriptions?

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 24, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 99.69%. Comparing base (3ffaa4f) to head (df22524).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
lib/workflows/role_actions.py 50.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #431      +/-   ##
==========================================
- Coverage   99.81%   99.69%   -0.12%     
==========================================
  Files         109      109              
  Lines        2643     2648       +5     
  Branches      331      332       +1     
==========================================
+ Hits         2638     2640       +2     
- Misses          4        7       +3     
  Partials        1        1              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sometimes we need to add more than one User to a given Project with the
same Role. The current version of the st2 action only allows a single
User each time. In this change, we allow the possibility of multiple
Users at once.

Changes:

* user field in the YAML file for the web form:
  * the variable for the username or user ID changed from type string to
    type array
  * description of the field changed accordingly

* python code
  * name of the function to add an user changed from "role_add()" to
    "role_add_single_user()"
  * create a new function with the old name "role_add()" that only loops
    over the list of users, calling the new function
    "role_add_single_user()" for each one of them
@jose-caballero jose-caballero force-pushed the allow_more_than_one_user branch from 4c44d0b to df22524 Compare March 24, 2026 09:05
Copy link
Copy Markdown
Collaborator

@meoflynn meoflynn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think codecov is showing a missing test to show that role_add does call and runs the method for adding users from a list

Copy link
Copy Markdown
Collaborator

@anish-mudaraddi anish-mudaraddi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're missing a test for your new function but its fine since we need this

@jose-caballero jose-caballero merged commit 078319d into main Mar 24, 2026
12 of 14 checks passed
@jose-caballero jose-caballero deleted the allow_more_than_one_user branch March 24, 2026 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants