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

chore: main to develop #375

Merged
merged 3 commits into from
Oct 4, 2024
Merged

chore: main to develop #375

merged 3 commits into from
Oct 4, 2024

Conversation

CalicoNino
Copy link
Contributor

@CalicoNino CalicoNino commented Oct 4, 2024

Chore PR to fix other PRs with changes.

Summary by CodeRabbit

  • New Features

    • Introduced automatic labeling of newly created issues with the "S-triage" label for better organization.
    • Added a GitHub Actions workflow to automate the addition of issues to a project board for triage.
  • Bug Fixes

    • Simplified the faucet utility functionality by reducing the amount of NIBI sent and removing customizable amounts.
  • Chores

    • Updated version number to 4.5.2 in the project documentation and package configuration.

cgilbe27 and others added 3 commits August 15, 2024 09:52
* revert: cosmos submodule only (#362)

* revert: cosmos submodule only

* fix: rem

* fix: rem

* fix: update

* feat: add msg client

* fix: paths

* fix: try chaosnet ibc

* fix: path again

* fix: try hm

* fix: fixes to pass

* feat: eth protos (#366)

* fix: eth protos

* fix: client

* fix: fixes

* fix: try older nibiru

* fix: index

* fix: mainnet

* fix: import

* revert: build change

* chore: tests (#367)

* fix: all query tests

* chore: final tests

* fix: buf

* fix: fix

* fix: pull latest

* fix: build

* fix: build

* refactor(faucet)!: set default tokens (#369)

* chore: develop -> main (#368)

* revert: cosmos submodule only (#362)

* revert: cosmos submodule only

* fix: rem

* fix: rem

* fix: update

* feat: add msg client

* fix: paths

* fix: try chaosnet ibc

* fix: path again

* fix: try hm

* fix: fixes to pass

* feat: eth protos (#366)

* fix: eth protos

* fix: client

* fix: fixes

* fix: try older nibiru

* fix: index

* fix: mainnet

* fix: import

* revert: build change

* chore: tests (#367)

* fix: all query tests

* chore: final tests

* fix: buf

* fix: fix

* fix: pull latest

* fix: build

* fix: build

* chore(release): 4.5.1

### [4.5.1](v4.5.0...v4.5.1) (2024-08-09)

### Miscellaneous Chores

* develop -> main ([#368](#368)) ([c6d6570](c6d6570)), closes [#362](#362) [#366](#366) [#367](#367)

 [skip ci]

* fix(faucet): remove unused tokens from default faucet request

* fix: bump test

---------

Co-authored-by: Cameron Gilbert <[email protected]>
Co-authored-by: semantic-release-bot <[email protected]>

---------

Co-authored-by: Kevin Yang <[email protected]>
Co-authored-by: semantic-release-bot <[email protected]>
### [4.5.2](v4.5.1...v4.5.2) (2024-09-24)

### Miscellaneous Chores

* develop -> main ([#370](#370)) ([ec2a25b](ec2a25b)), closes [#362](#362) [#366](#366) [#367](#367) [#369](#369) [#368](#368) [#362](#362) [#366](#366) [#367](#367) [#362](#362) [#366](#366) [#367](#367)
* **github:** Add project automation for https://tinyurl.com/25uty9w5 ([c2c27e5](c2c27e5))

 [skip ci]
Copy link
Contributor

coderabbitai bot commented Oct 4, 2024

Walkthrough

This pull request introduces several changes, including a new label configuration for GitHub issues, the addition of a GitHub Actions workflow for automating issue management, and updates to the project version in package.json. The workflow automates the labeling and project board assignment for newly opened issues. Additionally, modifications to the faucet utility tests and its implementation streamline the process of requesting funds, simplifying the expected amounts and removing customizable options.

Changes

File Change Summary
.github/issue-labeler-config.yml Added "S-triage" label for all newly opened issues using a regex match.
.github/workflows/gh-issues.yml Introduced a new workflow for automating issue management with jobs add-to-project and label-triage.
CHANGELOG.md Added new version entry 4.5.2, noted branch transition from develop to main, and referenced project automation.
package.json Updated version from 4.5.1 to 4.5.2.
src/sdk/utils/faucet.test.ts Skipped a test case, modified expected coins in tests, and removed custom amounts from requests.
src/sdk/utils/faucet.ts Updated useFaucet function to reduce sent amount from 11 to 10 NIBI and removed customizable amounts.

Possibly related PRs

Suggested labels

released

Poem

🐰 In the meadow where issues bloom,
A label dances, dispelling gloom.
With workflows swift, like a rabbit's hop,
Triage and labels, we never stop!
From NIBI's well, just ten we send,
Automation's magic, our new best friend! 🌼


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (7)
.github/issue-labeler-config.yml (3)

1-1: Fix typo in the comment

There's a small typo in the comment. Let's correct it for clarity.

- # Adds the "S-triage" label ot any issue that gets opened.
+ # Adds the "S-triage" label to any issue that gets opened.

2-3: Consider style improvements for better readability

While the current indentation is valid YAML, consider using 2 spaces for indentation as it's a common style guide recommendation for YAML files. Also, the regex pattern can be simplified.

 S-triage:
-  - "/.*/"
+   - "*"

This change maintains the functionality while improving readability and adhering to common YAML style practices.


1-3: Approve implementation with considerations for future enhancements

The implementation effectively adds the "S-triage" label to all new issues, which is a good practice for issue management. The simplicity of the configuration makes it easy to maintain and understand, ensuring no issues are missed in the triage process.

Consider the following points for potential future enhancements:

  1. Are there any exceptions where the "S-triage" label should not be applied?
  2. Are there any other default labels that should be applied to all new issues?
  3. How does this fit into the overall issue management workflow of the project?

These considerations could help refine the issue labeling process as the project evolves.

src/sdk/utils/faucet.ts (1)

16-16: Consider using a more explicit representation for the token amount

The hardcoded coins array correctly reflects the simplified functionality of sending only 10 NIBI. However, the use of scientific notation (10e6) for the token amount might be less immediately readable.

Consider using a more explicit representation for better readability:

- const coins: string[] = [`${10e6}unibi`]
+ const coins: string[] = [`${10_000_000}unibi`]

This change makes the exact amount clearer at a glance, especially for developers who might not be familiar with the token's decimal places.

.github/workflows/gh-issues.yml (1)

25-38: Review and update the "not-before" date regularly.

The label-triage job is well-structured and uses appropriate conditions and configurations. However, the hardcoded "not-before" date might cause issues if not updated regularly.

Consider one of the following options:

  1. Remove the "not-before" condition if it's not necessary.
  2. Use a relative date instead of an absolute one. For example:
    not-before: ${{ fromJson(github.event.issue.created_at) > fromJson(format('{0}Z', github.event.repository.created_at)) }}
    This will allow labeling for issues created after the repository's creation date.
  3. If you must use an absolute date, add a comment explaining why this specific date was chosen and when it should be reviewed.

Also, there's a small typo in the job name:

- name: "Add GH ticket to project"
+ name: "Label GH ticket"
src/sdk/utils/faucet.test.ts (2)

Line range hint 22-26: Consider alternative strategies for testing the faucet utility.

The test case "faucet utility works" is currently skipped due to the complexity of setting up a fake reCAPTCHA system. While this reasoning is understandable, skipping tests can lead to reduced coverage and potentially miss regressions.

Consider exploring alternative testing strategies that don't rely on reCAPTCHA:

  1. Mock the reCAPTCHA verification process in the test environment.
  2. Implement a test-only endpoint that bypasses reCAPTCHA for automated tests.
  3. Use dependency injection to replace the reCAPTCHA verification with a mock implementation during tests.

These approaches could allow you to test the faucet utility more comprehensively without the need for a complex reCAPTCHA setup.


Line range hint 1-134: Summary of changes and recommendations

The changes in this file appear to simplify the faucet functionality and its tests. However, there are a few points that require attention:

  1. The reduction in expected tokens from the faucet may impact test coverage. Verify if this aligns with the current faucet behavior and consider adding separate tests for unusd and uusdt if they are still supported.

  2. The removal of the custom amounts feature should be confirmed. If intentional, update the function signature and documentation accordingly.

  3. The skipped test for the faucet utility reduces overall test coverage. Consider implementing alternative testing strategies that don't rely on reCAPTCHA to ensure comprehensive testing of the faucet functionality.

These changes seem to align with the PR objective of addressing and fixing issues related to other pull requests. However, ensure that these modifications don't unintentionally reduce the robustness of the faucet functionality or its test coverage.

Consider creating a separate issue to track the improvement of faucet utility testing, especially for the skipped test case. This will ensure that this important aspect of the system doesn't get overlooked in future development cycles.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 1e6b7df and 470262f.

📒 Files selected for processing (6)
  • .github/issue-labeler-config.yml (1 hunks)
  • .github/workflows/gh-issues.yml (1 hunks)
  • CHANGELOG.md (1 hunks)
  • package.json (1 hunks)
  • src/sdk/utils/faucet.test.ts (2 hunks)
  • src/sdk/utils/faucet.ts (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • package.json
🧰 Additional context used
🪛 Markdownlint
CHANGELOG.md

6-6: null
Bare URL used

(MD034, no-bare-urls)


1-1: null
First line in a file should be a top-level heading

(MD041, first-line-heading, first-line-h1)

🔇 Additional comments (6)
src/sdk/utils/faucet.ts (2)

5-6: LGTM: Documentation updated correctly

The function documentation has been updated to accurately reflect the amount of NIBI sent (10 instead of 11). This change aligns with the actual implementation, improving the accuracy of the documentation.


Line range hint 1-54: Overall changes simplify the faucet functionality

The modifications to the useFaucet function effectively simplify its functionality by removing the option to send custom amounts of different tokens. Now, it only sends a fixed amount of 10 NIBI. This change aligns with the PR objectives of addressing issues in other pull requests.

Key impacts:

  1. Simplified interface: Removal of the amts parameter reduces potential misuse.
  2. Focused functionality: The function now has a single, clear purpose.
  3. Reduced flexibility: Custom token amounts are no longer supported, which might affect some use cases.

These changes contribute to a more maintainable and focused codebase, which is in line with the "chore" nature of this pull request.

.github/workflows/gh-issues.yml (2)

1-8: LGTM: Workflow name and trigger are well-defined.

The workflow name accurately describes its primary function, and the trigger events (issues being opened or labeled) are appropriate for the intended automation.


10-13: LGTM: Permissions are correctly set.

The permissions are appropriately configured for the workflow's tasks:

  • Write access to issues allows for adding labels and modifying issues.
  • Read access to contents is sufficient for most operations.
src/sdk/utils/faucet.test.ts (2)

94-96: Verify the removal of custom amounts feature.

The test case for custom amounts has been modified:

  1. The amts parameter has been removed from the useFaucet function call.
  2. The expected coins array now matches the default amounts test case.

These changes suggest that the custom amounts feature may have been removed from the faucet implementation.

Please confirm if the removal of the custom amounts feature is intentional and aligns with the current implementation. If this feature has indeed been removed, consider updating the function signature and documentation to reflect this change.

To verify the current faucet implementation, you can run the following script:

✅ Verification successful

Custom amounts feature successfully removed.

The useFaucet function no longer accepts the amts parameter, and the test cases have been updated accordingly. This confirms that the custom amounts feature has been intentionally removed from the faucet implementation.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the current faucet implementation and usage

# Test 1: Search for the faucet implementation
echo "Faucet Implementation:"
rg --type typescript -A 10 'export const useFaucet'

# Test 2: Search for usages of useFaucet in the codebase
echo "\nFaucet Usage:"
rg --type typescript 'useFaucet\('

Length of output: 256


Script:

#!/bin/bash
# Description: Verify the current faucet implementation and usage with correct file types

# Test 1: Search for the faucet implementation
echo "Faucet Implementation:"
rg --type ts --max-depth 10 'export const useFaucet'

# Test 2: Search for usages of useFaucet in the codebase
echo "\nFaucet Usage:"
rg --type ts 'useFaucet\('

Length of output: 467


Script:

#!/bin/bash
# Description: Retrieve the useFaucet function definition to verify its parameters

# Search for the useFaucet function definition with surrounding lines for context
echo "useFaucet Function Definition:"
rg --type ts -A 5 'export\s+async\s+function\s+useFaucet' src/sdk/utils/faucet.ts

Length of output: 245


81-81: Verify if the reduced faucet request aligns with current behavior.

The expected coins array has been simplified from ["11000000unibi", "100000000unusd", "100000000uusdt"] to ["10000000unibi"]. While this change streamlines the faucet request, it also reduces the test coverage by no longer checking for unusd and uusdt tokens.

Please confirm if this change accurately reflects the current behavior of the faucet. If so, consider adding separate test cases for unusd and uusdt to maintain comprehensive test coverage.

To verify the current faucet behavior, you can run the following script:

.github/workflows/gh-issues.yml Show resolved Hide resolved
@cgilbe27 cgilbe27 merged commit 49b0766 into develop Oct 4, 2024
@coderabbitai coderabbitai bot mentioned this pull request Oct 4, 2024
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.

4 participants