Skip to content

Conversation

@moshekaplan
Copy link

No description provided.

moshekaplan and others added 30 commits November 9, 2025 08:32
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5 to 6.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](actions/setup-python@v5...v6)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [cryptography](https://github.com/pyca/cryptography) from 45.0.6 to 46.0.3.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](pyca/cryptography@45.0.6...46.0.3)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-version: 46.0.3
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.4.1 to 9.0.0.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](pytest-dev/pytest@8.4.1...9.0.0)

---
updated-dependencies:
- dependency-name: pytest
  dependency-version: 9.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [cffi](https://github.com/python-cffi/cffi) from 1.17.1 to 2.0.0.
- [Release notes](https://github.com/python-cffi/cffi/releases)
- [Commits](python-cffi/cffi@v1.17.1...v2.0.0)

---
updated-dependencies:
- dependency-name: cffi
  dependency-version: 2.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
…github/workflows/actions/setup-python-6

Bump actions/setup-python from 5 to 6 in /.github/workflows
…github/workflows/actions/checkout-5

Bump actions/checkout from 4 to 5 in /.github/workflows
Add typing job (with failure)
Copy link

@tunnelsociety tunnelsociety left a comment

Choose a reason for hiding this comment

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

Hi, I am a beginner who is interested in this work. I have a lot of comments and questions but I am not a ScummVM team member, just some person; I'll defer to the team before commenting on certain aspects of this PR.

If it's ok, I am asking a few questions to learn about the code and changes.

(And I just wanted to indicate minor typo in a73f457 commit msg, but not sure of the most polite way to do that 😄)

jobs:
type-check:
runs-on: ubuntu-latest
continue-on-error: true # Allow graceful failure

Choose a reason for hiding this comment

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

the commit message says "with failure" but this line seems to specifically not fail in case of error, which I guess is the opposite; do I misunderstand the commit message?

"INSERT INTO game (name, engine, gameid, extra, platform, language) VALUES (%s, %s, %s, %s, %s, %s)",
(title, engine_last, gameid, extra, platform, lang),
)
# Try to get rid of @game_last and pass the variable explicitly instead

Choose a reason for hiding this comment

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

missing TODO or FIXME or similar? or do I misunderstand this change, or this comment in particular?

"INSERT INTO game (name, engine, gameid, extra, platform, language) VALUES (%s, %s, %s, %s, %s, %s)",
(title, engine_last, gameid, extra, platform, lang),
)
# Try to get rid of @game_last and pass the variable explicitly instead

Choose a reason for hiding this comment

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

this does not seem related to commit message "Demonstrate enumerate"; should it be a separate commit?

def normalised_path(name):
"""
Converts \ to / in filepaths, to avoid filesystem independent filepath parsing.
r"""

Choose a reason for hiding this comment

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

this does not seem related to commit message "Improve logging"; should it be a separate commit?

logging.basicConfig(
level=logging.INFO,
format='[%(levelname)s] %(asctime)s - %(name)s - %(message)s'
)

Choose a reason for hiding this comment

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

all commits should be "atomic" in the sense that they are parsable, buildable, etc.: so changes like 0366f2c "Add missing )" must be squashed (preferably in advance of a PR)

(more about this in ScummVM's Commit Guidelines, discussion about which I'd defer to team members)

Copy link
Author

Choose a reason for hiding this comment

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

The commits here were a bit messy. The simplest approach would be to squash this entire thing. Not sure how ScummVM team feels about that.

html += f"<td>{counter}.</td>\n"
html_code += "<tr>\n"
html_code += f"<td>{counter}.</td>\n"
# html += f"<td>{fileset_id}</td>\n"
Copy link

@tunnelsociety tunnelsociety Nov 10, 2025

Choose a reason for hiding this comment

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

Would it be wise to remove or adjust [old] commented code like # html += f"<td>{fileset_id}</td>\n" as well?
(edit: i wrote "unsafe" but that might not be the case here; thus this comment has very little meaning)

Copy link
Author

Choose a reason for hiding this comment

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

I see no reason why it couldn't be removd.

from src.scripts.db_functions import (
insert_game,
get_all_related_filesets,
convert_log_text_to_links,

Choose a reason for hiding this comment

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

It's a fine change, but moving the convert_log_text_to_links function is not described by commit message "Try to remove XSS from fileset"; should this be a separate commit?

Copy link
Author

Choose a reason for hiding this comment

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

Probably. I had moved it as part of doing the XSS sanitization.

@tunnelsociety
Copy link

tunnelsociety commented Nov 10, 2025

It concerns me a little that we need to worry about escaping many strings in many places to inject into HTML, with the potential to forget doing it anywhere and thus to introduce a security issue. In the interest of making it easier to write safe code, what if we don't write raw HTML, but instead manipulate HTML via some library, something like td = somehtmllib.createElement('td'); td.setText("any string which will be escaped appropriately"), assuming such lib exists? (maybe there are good, simple reasons for writing our own strings of HTML.)

(Edit: I haven't analyzed attack surface. Maybe it's all a non-issue because sensitive code is only on privileged code paths where we trust what's being injected)

@moshekaplan
Copy link
Author

It concerns me a little that we need to worry about escaping many strings in many places to inject into HTML, with the potential to forget doing it anywhere and thus to introduce a security issue. In the interest of making it easier to write safe code, what if we don't write raw HTML, but instead manipulate HTML via some library, something like td = somehtmllib.createElement('td'); td.setText("any string which will be escaped appropriately"), assuming such lib exists? (maybe there are good, simple reasons for writing our own strings of HTML.)

Yes, an accurate observation. Really, I'd think the ideal way is that each web endpoint should have three function calls in it:

  1. Validate parameters
  2. Use the parameters to obtain the per-page data
  3. Pass the data to a Jinja template (or the like) to pass in the dynamic values

Unfortunately, this code currently generates the raw HTML (yay for server side rendering!) and so we need to do the sanitization ourselves. I simply do not have the time to restructure everything.

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.

2 participants