Skip to content

Conversation

@yhouyang02
Copy link
Collaborator

This pull request introduces several infrastructure improvements, documentation enhancements, and codebase updates to support better development practices, automated versioning, and improved project visibility. The most significant changes are the addition of dynamic versioning with Hatch, new GitHub Actions workflows for code coverage and documentation previews, expanded documentation and badges, and updates to the minidict dataset.

Infrastructure and Automation:

  • Added dynamic versioning using hatch-vcs, including configuration in pyproject.toml and a generated src/wordguess/__version__.py file to automatically track and expose the package version. [1] [2] [3] [4] [5] [6]
  • Added GitHub Actions workflow for code coverage reporting via Codecov and updated the test workflow to generate XML coverage reports.
  • Added GitHub Actions workflow for previewing documentation on pull requests, deploying to Netlify with PR-specific URLs, and updating deployment status in GitHub.
  • Updated deployment workflow to trigger on version tags instead of pushes to main, supporting semantic versioning and manual dispatch.

Documentation and Project Visibility:

  • Added badges to README.md for TestPyPI version, build status, code quality, and documentation status, and improved installation and usage examples with a step-by-step tutorial. [1] [2]
  • Added CHANGELOG.md to the documentation site and navigation, and recorded new features and improvements for version 3.0.0. [1] [2] [3]
  • Expanded CONTRIBUTING.md with a detailed section on development tools, GitHub infrastructure, organizational practices, and scaling recommendations for larger projects.

Code and Dataset Updates:

  • Added new words to the built-in minidict dataset to improve game variety. [1] [2]
  • Improved docstrings in get_n_guesses.py for clarity and consistency, including parameter and error documentation. [1] [2] [3]

risha-daz and others added 30 commits January 26, 2026 10:23
Add code cov + update readme badges
doc preview workflow for pr to otter and main
add work organization and retrospective to CONTRIBUTING.md
Standardize and clean up docstrings, parameter typing, and error descriptions in get_n_guesses, get_result, get_score, and result_to_pattern. Added a See Also reference in get_result, clarified parameter/return blocks and raise messages, reformatted examples, and added inline sectioning comments in get_score (validation, score calculation, final computation, penalty). Changes are formatting and documentation-focused; no intended functional behavior changes.
Fix a malformed code fence and expand the README example into a clear, step-by-step usage guide. Changes show importing the package as an alias (wg), demonstrate wg.get_result with a simulated target, show how to get top guesses via wg.get_n_guesses (n=3), compute an overall score with wg.get_score, and convert a result to a human-readable pattern with wg.result_to_pattern. Also add explanatory comments to clarify the example flow.
yhouyang02 and others added 6 commits February 2, 2026 18:31
Expand and clarify development docs: add Conda, Codecov, Ruff, and quartodoc to tools; document gh-pages branch and CHANGELOG.md; note Copilot in code review. Reformat development workflow items to bullets, adjust CI/testing section (replace some specific coverage/benchmark entries with a generic Performance Tests item), and tidy repository/issue/pull request guidance. Remove an explicit Security subsection and make small editorial fixes for consistency.
Update CONTRIBUTING.md tools and workflows
@yhouyang02 yhouyang02 added this to the milestone4 milestone Feb 3, 2026
@yhouyang02 yhouyang02 requested review from Copilot and sgauth01 and removed request for Copilot February 3, 2026 03:02
@codecov
Copy link

codecov bot commented Feb 3, 2026

Codecov Report

❌ Patch coverage is 73.68421% with 5 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@4895f6e). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/wordguess/__version__.py 72.22% 4 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main      #92   +/-   ##
=======================================
  Coverage        ?   97.67%           
=======================================
  Files           ?       11           
  Lines           ?      430           
  Branches        ?       69           
=======================================
  Hits            ?      420           
  Misses          ?        6           
  Partials        ?        4           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sgauth01 sgauth01 merged commit 59e3d30 into main Feb 3, 2026
25 checks passed
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Prepares the project for the 3.0.0 release by introducing dynamic versioning, improving CI/CD automation, and expanding project documentation and visibility.

Changes:

  • Added Hatch VCS-based dynamic versioning and exposed package version via __version__.
  • Introduced/updated GitHub Actions workflows for docs previews, code coverage uploads, and tag-based deployments.
  • Expanded documentation (README, Quarto nav, CONTRIBUTING, CHANGELOG) and updated the built-in minidict dataset.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
src/wordguess/result_to_pattern.py Docstring formatting/clarity updates and inline comments.
src/wordguess/get_score.py Docstring adjustments and added inline comments around scoring logic.
src/wordguess/get_result.py Docstring clarification and “See Also” additions.
src/wordguess/get_n_guesses.py Docstring cleanup to match NumPy style.
src/wordguess/_internals.py Added new words to the built-in minidict.
src/wordguess/version.py Added generated version module intended for dynamic versioning.
src/wordguess/init.py Exposed __version__ at package import level.
pyproject.toml Enabled dynamic versioning via hatch-vcs and configured version-file generation.
_quarto.yml Added CHANGELOG to documentation project and navigation.
README.md Added badges and expanded step-by-step usage example.
CONTRIBUTING.md Added detailed development tooling/infrastructure guidance.
CHANGELOG.md Added release notes section for 3.0.0.
.github/workflows/docs-preview.yml New workflow to build and deploy PR docs previews to Netlify.
.github/workflows/deploy.yml Updated publishing workflow triggers to run on version tags.
.github/workflows/build.yml Updated test workflow to generate XML coverage and upload to Codecov.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


## Code of Conduct

Please not that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

Typo: “Please not that” should be “Please note that”.

Suggested change
Please not that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.

Copilot uses AI. Check for mistakes.
Comment on lines +5 to +7
| Package | [![Latest Test PyPI Version](https://img.shields.io/pypi/v/wordguess?label=TestPyPI&logo=python&color=blue&pypiBaseUrl=https%3A%2F%2Ftest.pypi.org)](https://test.pypi.org/project/wordguess/) [![Supported Python Versions](https://img.shields.io/badge/python->=3.10-blue?logo=python)](https://test.pypi.org/project/wordguess/) |
| Meta | [![Code of Conduct](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md) [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
|Testing |[![Unit Tests](https://github.com/UBC-MDS/wordguess/actions/workflows/build.yml/badge.svg)](https://github.com/UBC-MDS/wordguess/actions/workflows/build.yml) [![codecov](https://codecov.io/github/UBC-MDS/wordguess/graph/badge.svg?token=wxpY8GJ0LI)](https://codecov.io/github/UBC-MDS/wordguess) |
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

The Markdown table is malformed: the “Meta” row is missing the trailing |, which breaks table rendering in many viewers. Add the closing pipe (and keep column alignment consistent with the other rows).

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +2
# file generated by setuptools-scm
# don't change, don't track in version control
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

This version file header says it was generated by setuptools-scm and “don’t track in version control”, but this repo is configured for Hatch (hatch-vcs) and the file is committed in this PR. Update the header to reflect the actual tool/process, or stop committing the generated file and adjust runtime version retrieval accordingly.

Suggested change
# file generated by setuptools-scm
# don't change, don't track in version control
# Version information for the wordguess package.
# This file is maintained by the packaging/release process; do not edit by hand.

Copilot uses AI. Check for mistakes.
Comment on lines +31 to +34
__version__ = version = '1.0.0.post1.dev60'
__version_tuple__ = version_tuple = (1, 0, 0, 'post1', 'dev60')

__commit_id__ = commit_id = None
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

__version__ is hard-coded to 1.0.0.post1.dev60, which will drift from the actual VCS/tag version and contradicts the intended 3.0.0 release. For dynamic versioning, ensure this module is generated during build from VCS metadata (or compute version at runtime via package metadata) so the installed package reports the correct version.

Copilot uses AI. Check for mistakes.
from wordguess.get_result import get_result
from wordguess.get_score import get_score
from wordguess.result_to_pattern import result_to_pattern
from .__version__ import __version__ No newline at end of file
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

Importing __version__ from a generated module can make import wordguess fail in contexts where the version file hasn’t been generated yet (e.g., source checkouts/editable installs if the file isn’t committed). Consider using importlib.metadata.version("wordguess") (with a safe fallback) or ensure the version module is always present in source distributions.

Suggested change
from .__version__ import __version__
try:
from importlib.metadata import PackageNotFoundError, version
except ImportError:
# Fallback for very old Python versions without importlib.metadata
__version__ = "0.0.0"
else:
try:
__version__ = version("wordguess")
except PackageNotFoundError:
__version__ = "0.0.0"

Copilot uses AI. Check for mistakes.
Comment on lines +27 to 29
result : list
A list containing the list of result. The result is a string
with characters '0', '1', and '2' representing different guess outcomes.
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

The docstring type for result was broadened to list, but the function signature is result: list[str] and the implementation requires a list of strings. Align the docstring with the actual expected type (e.g., “list[str]” / “list of str”) and tighten the wording (“list of result strings”).

Suggested change
result : list
A list containing the list of result. The result is a string
with characters '0', '1', and '2' representing different guess outcomes.
result : list[str]
A list of result strings. Each string contains
characters '0', '1', and '2' representing different guess outcomes.

Copilot uses AI. Check for mistakes.
Comment on lines +62 to +65
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }} No newline at end of file
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

The Codecov upload step unconditionally references secrets.CODECOV_TOKEN, which is unavailable on PRs from forks and can cause CI failures. Gate this step behind a condition (e.g., only run when the secret is present / when the PR is from the same repo), or use tokenless uploads if the repository is public and supported by your Codecov setup.

Copilot uses AI. Check for mistakes.
Comment on lines +10 to +12
runs-on: ubuntu-latest
permissions:
contents: write
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

This workflow runs on pull_request while granting write permissions (contents: write, deployments: write) and executing PR-controlled code (pip install -e .[docs], quartodoc build, quarto render). That combination is risky because a malicious change in the PR could abuse the write-scoped GITHUB_TOKEN. Reduce default permissions to read-only and/or gate the deployment steps so they only run for same-repo PRs (not forks), or move the deployment portion to a safer event/approach (e.g., restricted workflow_dispatch or a carefully-audited pull_request_target + artifact flow).

Suggested change
runs-on: ubuntu-latest
permissions:
contents: write
if: github.event_name == 'workflow_dispatch' || github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
permissions:
contents: read

Copilot uses AI. Check for mistakes.
Comment on lines +13 to +23
TYPE_CHECKING = False
if TYPE_CHECKING:
from typing import Tuple
from typing import Union

VERSION_TUPLE = Tuple[Union[int, str], ...]
COMMIT_ID = Union[str, None]
else:
VERSION_TUPLE = object
COMMIT_ID = object

Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

This statement is unreachable.

Suggested change
TYPE_CHECKING = False
if TYPE_CHECKING:
from typing import Tuple
from typing import Union
VERSION_TUPLE = Tuple[Union[int, str], ...]
COMMIT_ID = Union[str, None]
else:
VERSION_TUPLE = object
COMMIT_ID = object
from typing import Tuple
from typing import Union
VERSION_TUPLE = Tuple[Union[int, str], ...]
COMMIT_ID = Union[str, None]

Copilot uses AI. Check for mistakes.
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.

5 participants