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

SNOW-957349: Make some API/classes needed in stored procs public #1570

Merged
merged 5 commits into from
Dec 1, 2023

Conversation

sfc-gh-smirzaei
Copy link
Collaborator

@sfc-gh-smirzaei sfc-gh-smirzaei commented Nov 29, 2023

Overview

SNOW-957349

External contributors - please answer these questions before submitting a pull request. Thanks!

Please answer these questions before submitting your pull requests. Thanks!

  1. What GitHub issue is this PR addressing? Make sure that there is an accompanying issue to your PR.

    Fixes #NNNN

  2. Fill out the following pre-review checklist:

    • I am adding a new automated test(s) to verify correctness of my new code
    • I am adding new logging messages
    • I am modifying authorization mechanisms
    • I am adding new credentials
    • I am modifying OCSP code
    • I am adding a new dependency
  3. Please describe how your code solves the related issue.
    As part of changes we made for enabling async child job in JVM stored procs, we needed to access some classes/APIs from the public library that are not public. Hence we had to create util methods in net/snowflake/client package (see this PR ...braries/jdbc-stored-proc/src/main/java/net/snowflake/client/core/StoredProcCoreUtils.java). This is a follow up change to make those classes/APIs public.

Can someone please point me to the precommit jenkins job that I need to run to test this?

Pre-review checklist

  • This change has passed precommit
  • I have reviewed code coverage report for my PR in (Sonarqube)

@sfc-gh-igarish
Copy link
Collaborator

@sfc-gh-smirzaei are we going to document this public types for any customers to use or just for internal purpose only? If it is only for internal purpose, please comment to propagate that message like "internal use only". Also check style merge gate failed so please run "mvn com.spotify.fmt:fmt-maven-plugin:format". This will format the code as needed.

@sfc-gh-dprzybysz
Copy link
Collaborator

@sfc-gh-smirzaei Please add issue id to the PR name and/or commit message

@sfc-gh-smirzaei
Copy link
Collaborator Author

@sfc-gh-smirzaei are we going to document this public types for any customers to use or just for internal purpose only? If it is only for internal purpose, please comment to propagate that message like "internal use only". Also check style merge gate failed so please run "mvn com.spotify.fmt:fmt-maven-plugin:format". This will format the code as needed.

We need this for internal use, but nothing is going to prevent these to be used publicly, so does it stillactually make sense to add "internal use only"? In general considering our workaround

@sfc-gh-smirzaei are we going to document this public types for any customers to use or just for internal purpose only? If it is only for internal purpose, please comment to propagate that message like "internal use only". Also check style merge gate failed so please run "mvn com.spotify.fmt:fmt-maven-plugin:format". This will format the code as needed.

I'm making this change for internal use in stored procs, but I assume nothing prevents public use-cases, so does it still make sense to add "internal use only" for something that is visible and accessible publicly?
In general considering our workaround for accessing these APIs/classes in this PR (https://github.com/snowflakedb/snowflake/pull/114773/files#diff-bb0f0d7b309b4b22ebeef522d0c556a4592aa80c198354099ee37ebd8551dae5), what do you think about this change? Do you see any downside?

Also thank you for the pointer for the formatting issue.

@sfc-gh-igarish
Copy link
Collaborator

sfc-gh-igarish commented Nov 29, 2023

"We need this for internal use, but nothing is going to prevent these to be used publicly, so does it stillactually >>make sense to add "internal use only"? In general considering our workaround"

As our source code is public, if we intended to use for internal purpose then better to tag that way, so if someone use and asking for support, we can say that please don't use or use it as per your own risk. Unless you think it will be useful for community to use this method. So it's more to protect from support side. We have seen that if public method use as intended it works but if many people start using it as non-intended purpose, we will be busy to fix and support it.

@sfc-gh-smirzaei
Copy link
Collaborator Author

"We need this for internal use, but nothing is going to prevent these to be used publicly, so does it stillactually >>make sense to add "internal use only"? In general considering our workaround"

As our source code is public, if we intended to use for internal purpose then better to tag that way, so if someone use and asking for support, we can say that please don't use or use it as per your own risk. Unless you think it will be useful for community to use this method. So it's more to protect from support side. We have seen that if public method use as intended it works but if many people start using it as non-intended purpose, we will be busy to fix and support it.

I see, good point. I'll add those comments.

@sfc-gh-smirzaei
Copy link
Collaborator Author

@sfc-gh-igarish the requested comment is added, please take a look once you get a chance.
On a separate note, do we have a jenkin job precommit I need to run before merging?

Copy link
Collaborator

@sfc-gh-igarish sfc-gh-igarish left a comment

Choose a reason for hiding this comment

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

LGTM

@sfc-gh-igarish
Copy link
Collaborator

sfc-gh-igarish commented Nov 29, 2023

On a separate note, do we have a jenkin job precommit I need to run before merging?

It will as part of this PR. We have JDBC-PC jobs run as part of each PR. So if all tests are running fine as github action, we are good. Monitor this github action check: "continuous-integration/jenkins/pr-merge" It shouldn't fail.

@sfc-gh-smirzaei sfc-gh-smirzaei changed the title Make some API/classes needed in stored procs public SNOW-957349: Make some API/classes needed in stored procs public Nov 30, 2023
Copy link

SonarQube Quality Gate

Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@sfc-gh-smirzaei sfc-gh-smirzaei merged commit dacea07 into master Dec 1, 2023
27 of 28 checks passed
@sfc-gh-smirzaei sfc-gh-smirzaei deleted the smirzaei-SNOW-957349-make-needed-API-public branch December 1, 2023 19:48
@github-actions github-actions bot locked and limited conversation to collaborators Dec 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants