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

Jira Software parsing and permission resolvers with unit tests #60

Merged

Conversation

dxu2atlassian
Copy link
Contributor

As Jira Software swagger doc format isn't the same format as others like Bitbucket, JSM, etc.

@dxu2atlassian dxu2atlassian force-pushed the feat/EAS-2547-js-parsing branch 8 times, most recently from 311d709 to e2fc593 Compare December 23, 2024 22:48
@dxu2atlassian dxu2atlassian marked this pull request as ready for review December 23, 2024 22:50
let request_type = RequestType::Get;
let result = check_url_for_permissions(&permission_map, &regex_map, request_type, url);

println!("Permission Map: {:?}", permission_map);
Copy link
Contributor

Choose a reason for hiding this comment

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

@jwong101 @jwong33 should we remove debug text ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, this should be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Gotcha, do we also want to remove debug text from the other existing test cases as well?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I think that'd be good. I see there is some from my code too 😬 😓

@dxu2atlassian dxu2atlassian force-pushed the feat/EAS-2547-js-parsing branch from e2fc593 to d52f69e Compare December 31, 2024 05:19

if scopes.is_empty() {
// For Jira Software if the initial scopes are empty, try the scopes from the security field
scopes.extend(
Copy link
Contributor

Choose a reason for hiding this comment

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

Are there any cases where the security field has additional scopes with a nonempty permission field?

if intrinsic_func_type == IntrinsicName::RequestJiraSoftware {
let permissions = check_url_for_permissions(
interp.jira_software_permission_resolver,
interp.jira_software_regex_map,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think a match statement for intrinsic_func_type would be more idiomatic here. I realize this was originally my code, sorry 😓.

Also, maybe we have the second argument be set to get if it does not exists. That eliminates the need for the first if else block.

Copy link
Contributor

Choose a reason for hiding this comment

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

These may be out of scope for this PR, and I can make the changes since this was originally my bad code.

Copy link
Contributor

Choose a reason for hiding this comment

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

… resolver with unit tests and refactor products to use match statement
@dxu2atlassian dxu2atlassian force-pushed the feat/EAS-2547-js-parsing branch from d52f69e to 0ce2619 Compare January 3, 2025 00:16
@jwong101 jwong101 merged commit a7ad816 into atlassian-labs:main Jan 3, 2025
4 checks passed
@dxu2atlassian dxu2atlassian deleted the feat/EAS-2547-js-parsing branch January 3, 2025 20:24
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