Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 2, 2026

fix: #3

@hsluoyz
Copy link
Member

hsluoyz commented Feb 2, 2026

@nodece @Shivansh-yadav13 please review

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@hsluoyz hsluoyz marked this pull request as ready for review February 2, 2026 16:06
Copilot AI and others added 3 commits February 2, 2026 16:07
Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com>
Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com>
Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com>
Copilot AI changed the title [WIP] Rewrite CI scripts and update README with badges Modernize CI workflow and README to match node-casbin standards Feb 2, 2026
Copilot AI requested a review from hsluoyz February 2, 2026 16:12
@hsluoyz
Copy link
Member

hsluoyz commented Feb 2, 2026

@copilot fix: https://github.com/node-casbin/session-role-manager/actions/runs/21597728574/job/62236276185?pr=4

Run yarn run test
  yarn run test
  shell: /usr/bin/bash -e {0}
yarn run v1.22.22
$ jest
ts-jest[versions] (WARN) Version 26.6.3 of jest installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=25.0.0 <26.0.0). Please do not report issues in ts-jest if you are using unsupported versions.
FAIL test/testRoleManager.test.ts
  ● Test suite failed to run

    test/testRoleManager.test.ts:15:25 - error TS2345: Argument of type 'SessionRoleManager' is not assignable to parameter of type 'RoleManager'.
      Type 'SessionRoleManager' is missing the following properties from type 'RoleManager': getDomains, getAllDomains

    15   await testSessionRole(rm, 'alpha', 'bravo', getCurrentTime(), true);
                               ~~
    test/testRoleManager.test.ts:16:25 - error TS2345: Argument of type 'SessionRoleManager' is not assignable to parameter of type 'RoleManager'.

    16   await testSessionRole(rm, 'alpha', 'charlie', getCurrentTime(), true);
                               ~~
    test/testRoleManager.test.ts:17:25 - error TS2345: Argument of type 'SessionRoleManager' is not assignable to parameter of type 'RoleManager'.

    17   await testSessionRole(rm, 'bravo', 'delta', getCurrentTime(), true);
                               ~~
    test/testRoleManager.test.ts:18:25 - error TS2345: Argument of type 'SessionRoleManager' is not assignable to parameter of type 'RoleManager'.

    18   await testSessionRole(rm, 'bravo', 'echo', getCurrentTime(), true);
                               ~~
    test/testRoleManager.test.ts:19:25 - error TS2345: Argument of type 'SessionRoleManager' is not assignable to parameter of type 'RoleManager'.

    19   await testSessionRole(rm, 'charlie', 'echo', getCurrentTime(), true);
                               ~~
    test/testRoleManager.test.ts:20:25 - error TS2345: Argument of type 'SessionRoleManager' is not assignable to parameter of type 'RoleManager'.

    20   await testSessionRole(rm, 'charlie', 'foxtrott', getCurrentTime(), true);
                               ~~
    test/testRoleManager.test.ts:22:25 - error TS2345: Argument of type 'SessionRoleManager' is not assignable to parameter of type 'RoleManager'.

    22   await testSessionRole(rm, 'alpha', 'bravo', getOneHourAgo(), false);
                               ~~
    test/testRoleManager.test.ts:23:25 - error TS2345: Argument of type 'SessionRoleManager' is not assignable to parameter of type 'RoleManager'.

    23   await testSessionRole(rm, 'alpha', 'charlie', getOneHourAgo(), false);
                               ~~
    test/testRoleManager.test.ts:24:25 - error TS2345: Argument of type 'SessionRoleManager' is not assignable to parameter of type 'RoleManager'.

    24   await testSessionRole(rm, 'bravo', 'delta', getOneHourAgo(), false);
                               ~~
    test/testRoleManager.test.ts:25:25 - error TS2345: Argument of type 'SessionRoleManager' is not assignable to parameter of type 'RoleManager'.

    25   await testSessionRole(rm, 'bravo', 'echo', getOneHourAgo(), false);

    55   await testSessionRole(rm, 'charlie', 'echo', getCurrentTime(), false);
                               ~~
    test/testRoleManager.test.ts:56:25 - error TS2345: Argument of type 'SessionRoleManager' is not assignable to parameter of type 'RoleManager'.

    56   await testSessionRole(rm, 'charlie', 'foxtrott', getCurrentTime(), false);
                               ~~
    test/testRoleManager.test.ts:119:31 - error TS2345: Argument of type 'SessionRoleManager' is not assignable to parameter of type 'RoleManager'.

    119   await testPrintSessionRoles(rm, 'alpha', getOneHourAgo(), ['bravo']);
                                      ~~
    test/testRoleManager.test.ts:120:31 - error TS2345: Argument of type 'SessionRoleManager' is not assignable to parameter of type 'RoleManager'.

    120   await testPrintSessionRoles(rm, 'alpha', getCurrentTime(), ['bravo']);
                                      ~~
    test/testRoleManager.test.ts:121:31 - error TS2345: Argument of type 'SessionRoleManager' is not assignable to parameter of type 'RoleManager'.

    121   await testPrintSessionRoles(rm, 'alpha', getAfterOneHour(), []);
                                      ~~
    test/testRoleManager.test.ts:125:31 - error TS2345: Argument of type 'SessionRoleManager' is not assignable to parameter of type 'RoleManager'.

    125   await testPrintSessionRoles(rm, 'alpha', getOneHourAgo(), ['bravo', 'charlie']);
                                      ~~
    test/testRoleManager.test.ts:126:31 - error TS2345: Argument of type 'SessionRoleManager' is not assignable to parameter of type 'RoleManager'.

    126   await testPrintSessionRoles(rm, 'alpha', getAfterCurrentTime(), ['bravo']);
                                      ~~
    test/testRoleManager.test.ts:127:31 - error TS2345: Argument of type 'SessionRoleManager' is not assignable to parameter of type 'RoleManager'.

    127   await testPrintSessionRoles(rm, 'alpha', getAfterOneHour(), []);
                                      ~~
    test/testRoleManager.test.ts:131:31 - error TS2345: Argument of type 'SessionRoleManager' is not assignable to parameter of type 'RoleManager'.

    131   await testPrintSessionRoles(rm, 'alpha', getOneHourAgo(), ['bravo', 'charlie']);
                                      ~~
    test/testRoleManager.test.ts:132:31 - error TS2345: Argument of type 'SessionRoleManager' is not assignable to parameter of type 'RoleManager'.

    132   await testPrintSessionRoles(rm, 'alpha', getCurrentTime(), ['bravo', 'charlie']);
                                      ~~
    test/testRoleManager.test.ts:133:31 - error TS2345: Argument of type 'SessionRoleManager' is not assignable to parameter of type 'RoleManager'.

    133   await testPrintSessionRoles(rm, 'alpha', getAfterOneHour(), []);
                                      ~~
    test/testRoleManager.test.ts:170:20 - error TS2345: Argument of type 'SessionRoleManager' is not assignable to parameter of type 'RoleManager'.

    170   e.setRoleManager(rm);
                           ~~

Test Suites: 1 failed, 1 total
Tests:       0 total
Snapshots:   0 total
Time:        1.439 s
Ran all test suites.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error: Process completed with exit code 1.

…e resolution

Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 2, 2026

@copilot fix: https://github.com/node-casbin/session-role-manager/actions/runs/21597728574/job/62236276185?pr=4

...

Fixed in commit ab6b0b2. The issue was that SessionRoleManager was missing the getDomains() and getAllDomains() methods required by the RoleManager interface. I've implemented both methods to return empty arrays since this role manager doesn't support domains. I also fixed a Jest module resolution issue with csv-parse/sync. All tests now pass (9/9).

@hsluoyz hsluoyz changed the title Modernize CI workflow and README to match node-casbin standards feat: modernize CI workflow and README, fix the code Feb 2, 2026
@hsluoyz hsluoyz merged commit 25d01ec into master Feb 2, 2026
7 of 8 checks passed
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.

[feature] re-write the whole CI scripts and README content text, add all README badges

3 participants