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

[pull] master from erlang:master #254

Merged
merged 7 commits into from
Mar 21, 2025
Merged

[pull] master from erlang:master #254

merged 7 commits into from
Mar 21, 2025

Conversation

pull[bot]
Copy link

@pull pull bot commented Mar 21, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.1)

Can you help keep this open source service alive? 💖 Please sponsor : )

bjorng and others added 7 commits March 18, 2025 12:42
…r-funs

beam_debug_info: Emit a proper entry debug_line for funs
* bjorn/asn1/decode-jer/ERIERL-1206/OTP-19547:
  ASN.1 JER: Support decoding already decoded JSON data
* maint:
  ASN.1 JER: Support decoding already decoded JSON data
…-19537

Fix `gen_server` plain timeouts being canceled by `system` messages
@pull pull bot added the ⤵️ pull label Mar 21, 2025
@pull pull bot merged commit 081c77f into garazdawi:master Mar 21, 2025
Copy link

sourcery-ai bot commented Mar 21, 2025

Reviewer's Guide by Sourcery

This pull request includes changes to the ASN1 compiler and runtime to add support for decoding pre-decoded JSON, improvements to gen_server timeout handling and hibernation, and fixes to debug line information in the compiler. It also includes a new test function for BER and JER.

Sequence diagram for gen_server timeout handling

sequenceDiagram
  participant Server
  Server->>Server: receive Msg
  Server->>Server: decode_msg(Msg)
  alt timeout
    Server->>Server: loop(infinity)
  else HibernateAfterTimeout
    Server->>Server: loop_hibernate()
    Server->>Server: erlang:hibernate()
    Server->>Server: loop_wakeup()
  end
Loading

Updated class diagram for c_fun

classDiagram
    class c_fun {
        -anno: list
        -vars: list
        -body: object
    }
    note for c_fun "The 'anno' attribute in the c_fun class is updated to include debug line information."
Loading

Updated class diagram for server_data

classDiagram
    class server_data {
        -module: atom
        -parent: pid
        -tag: term
        -hibernate_after: timeout
        -handle_info: fun
        -handle_continue: fun
    }
    note for server_data "The 'hibernate_after' attribute is added to the server_data class."
Loading

File-Level Changes

Change Details Files
Introduces special decode functionality for JSON Encoding Rules (JER) by allowing the decode/2 function to accept data that has already been decoded by json:decode/1.
  • Added a case to handle {json_decoded, Decoded} in pgen_dispatcher_decode/3.
  • Added documentation for the new JER decode functionality.
lib/asn1/src/asn1ct_gen.erl
lib/asn1/doc/guides/asn1_getting_started.md
Modified gen_server to improve timeout handling and hibernation.
  • Refactored loop/4 to use decode_msg/6 for timeout messages.
  • Modified decode_msg/6 to accept a hibernation timeout.
  • Added handle_event_timeout_plain/1 test case to gen_server_SUITE to verify that system messages do not cancel plain timeouts.
  • Removed loop_continue/4.
lib/stdlib/src/gen_server.erl
lib/stdlib/test/gen_server_SUITE.erl
Fixed debug line information in the compiler.
  • Modified beam_ssa_codegen.erl to correctly handle debug line arguments.
  • Modified beam_core_to_ssa.erl to handle debug line information.
  • Modified v3_core.erl to handle debug line information.
  • Modified beam_asm.erl to convert bdi names to terms.
  • Modified beam_debug_info_SUITE.erl to extract source variables.
lib/compiler/src/sys_coverage.erl
lib/compiler/src/beam_ssa_codegen.erl
lib/compiler/src/beam_core_to_ssa.erl
lib/compiler/src/v3_core.erl
lib/compiler/src/beam_asm.erl
lib/compiler/test/beam_debug_info_SUITE.erl
Added special test functionality for BER and JER.
  • Added test_special/4 to test indefinite decoding for BER and already decoded JSON for JER.
lib/asn1/test/asn1_test_lib.erl

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants