Skip to content

Ci add codeql - #23812

Merged
tacaswell merged 3 commits into
matplotlib:mainfrom
tacaswell:ci_add_codeql
Nov 30, 2022
Merged

tacaswell merged 3 commits into
matplotlib:mainfrom
tacaswell:ci_add_codeql

Conversation

@tacaswell

Copy link
Copy Markdown
Member

PR Summary

replaces #22446

@tacaswell tacaswell added this to the v3.7.0 milestone Sep 6, 2022
@tacaswell tacaswell mentioned this pull request Sep 6, 2022
@tacaswell

Copy link
Copy Markdown
Member Author

I will squash this down once it is working.

@tacaswell

Copy link
Copy Markdown
Member Author

I tried manually dismissing all of the warnings from exten/ or build/, lets see if that reduces the noise?

I'm a bit unclear where that state lives though.

Comment thread .github/workflows/codeql-analysis.yml Resolved

@oscargus oscargus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this looks good! Probably we still want someone more experienced than me to say something more insightful... (I am primarily experienced in browsing static code checking results, not setting them up...)

@tacaswell

Copy link
Copy Markdown
Member Author

I would also like feedback from @QuLogic or @anntzer about the c++ changes to deal with the overflows (I did it two ways, is one better than the other? Is it important to be consistent here? should we have just pushed everything to bigger types?).

@anntzer

anntzer commented Sep 7, 2022 •

Copy link
Copy Markdown
Contributor

It would probably be better to be consistent and use ssize_t everywhere, but let's not lose sleep over that for now.

Also, AFAICT the whole to_string_argb is completely unused (and can be easily implemented with numpy, it's the similar to one-line byteorder swap in cbook._premultiplied_argb32_to_unmultiplied_rgba8888 without the extra alpha handling), so I would just deprecate it together with the Python-level wrappers.

@tacaswell

Copy link
Copy Markdown
Member Author

Back to draft because the build does not work again...

Comment thread src/_backend_agg.h
inline size_t num_paths() const
{
return m_meshWidth * m_meshHeight;
return (size_t) m_meshWidth * m_meshHeight;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

py_adaptors.h defines num_paths as Py_ssize_t, perhaps better for consistency, though anything will work, of course.

@anntzer

anntzer commented Oct 21, 2022

Copy link
Copy Markdown
Contributor

Nearly all the changes just hit the now deprecated to_string{,_argb}; just left an additional point re: signedness of num_paths, though it's not a big deal either way.

@QuLogic

QuLogic commented Nov 26, 2022

Copy link
Copy Markdown
Member

OK, this is now passing, though I will likely want to clean up the YAML. The JavaScript analysis takes ~6m; the C++/Python one takes ~17m. I think I can split C++/Python back up again now that it's working so that it'll finish quicker. Hopefully we don't end up with too many workflows running in parallel.

@QuLogic
QuLogic force-pushed the ci_add_codeql branch 4 times, most recently from e3e83db to 7430026 Compare November 26, 2022 06:26
Co-authored-by: Oscar Gustafsson <oscar.gustafsson@gmail.com>
Co-authored-by: Thomas A Caswell <tcaswell@gmail.com>
tacaswell and others added 2 commits November 26, 2022 02:43
If you only do a build step (i.e., `python setup.py build`), it does not
go through all the build dependency machinery, and then mysteriously
says it 'cannot download' a URL, but really it's a missing dependency.
@QuLogic

QuLogic commented Nov 26, 2022

Copy link
Copy Markdown
Member

I squashed down everything, removed the C++ change and confirmed that CodeQL is still warning about it, so I've now added it back in along with a more explicit message about why the build broke earlier.

@QuLogic
QuLogic marked this pull request as ready for review November 26, 2022 08:16
@tacaswell

Copy link
Copy Markdown
Member Author

This is my PR so I can not approve it, but 👍🏻 from me.

Do we want to standardize the c++ any more or not worry about that right now?

@QuLogic

QuLogic commented Nov 30, 2022

Copy link
Copy Markdown
Member

I think since they're deprecated, it's fine to leave them slightly inconsistent since they'll be deleted.

@tacaswell
tacaswell merged commit 8f0003a into matplotlib:main Nov 30, 2022
@tacaswell
tacaswell deleted the ci_add_codeql branch November 30, 2022 21:01
@QuLogic QuLogic added the CI: testing CI configuration and testing label Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI: testing CI configuration and testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants