Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The Hitchhiker's Guide to Servo Contributor

cybai
October 26, 2019

The Hitchhiker's Guide to Servo Contributor

cybai

October 26, 2019
Tweet

More Decks by cybai

Other Decks in Programming

Transcript

  1. The Hitchhiker’s Guide to
    Servo Contributor
    @_cybai, HERP, Inc.
    Rust.Tokyo

    View Slide

  2. whoami
    ● Haku
    ● @CYBAI
    ● @_cybai
    ● Software Engineer @ HERP, Inc.
    ● Contribute to Servo from Aug 2017
    2

    View Slide

  3. ● What is Servo?
    ● How to contribute?
    ● How to run tests?
    ● How Servo CI works?
    Agenda
    3

    View Slide

  4. ● What is Servo?
    ● How to contribute?
    ● How to run tests?
    ● How Servo CI works?
    Agenda
    4

    View Slide

  5. ● A modern, high-performance greenfield browser
    engine designed for both application and
    embedded use
    ● Written in Rust
    ● Aim to achieve parallel and concurrency
    computing and layout
    ● Derived memory safety and security from Rust
    What is Servo?
    5

    View Slide

  6. What is Servo? (Cont.)
    ● Two successful components have been migrated into
    Firefox, e.g. Stylo and WebRender
    6

    View Slide

  7. Demo
    7

    View Slide

  8. ● What is Servo?
    ● How to contribute?
    ● How to run tests?
    ● How Servo CI works?
    Agenda
    8

    View Slide

  9. Workflow
    9
    Find
    issue
    Implementation
    Test related
    WPT locally
    Send /
    Update
    PR
    Review
    PR merged
    Run
    CI
    passed with r+
    Check
    Failures
    : Sucess
    : Failure

    View Slide

  10. How to get involved?
    ● Check E-* labels
    ○ E stands for Effort here.
    ○ E-easy and E-less easy are good for new contributors.
    ○ E-candidate-for-mentoring means it might be an easy
    issue because members didn’t check it carefully. But, they
    will mentor you to finish the issue.
    ○ E-hard means challenging tasks.
    10
    Ref: Tag label names and definitions

    View Slide

  11. How to get involved? (Cont.)
    ● Check the Servo starter page.
    ● Find any Web API you’re interested in and it’s missing
    or implemented incorrectly in Servo!
    11

    View Slide

  12. 12
    The first issue I fixed

    View Slide

  13. 13
    From WHATWG DOM spec

    View Slide

  14. 14

    View Slide

  15. 15
    But, how can I confirm my
    implementation is correct?

    View Slide

  16. ● What is Servo?
    ● How to contribute?
    ● How to run tests?
    ● How Servo CI works?
    Agenda
    16

    View Slide

  17. WPT
    ● In Software Engineering, writing tests to
    verify our business logic is indispensable.
    ● So do the web platforms!
    ● Here comes the Web Platform Tests a.k.a
    wpt.
    17

    View Slide

  18. “The web-platform-tests project is a W3C-coordinated
    attempt to build a cross-browser test suite for the
    Web-platform stack.”
    -- web-platform-tests.org
    What is wpt?
    18

    View Slide

  19. Brief introduction to WPT metadata
    19

    View Slide

  20. How to run tests with Servo CI?
    20
    Ask @bors-servo to trigger “try” tests

    View Slide

  21. How to run tests with Servo CI? (Cont.)
    21
    CI tests triggered by try will report tests result
    when all tests passed instead of merging PR

    View Slide

  22. How to run tests with Servo CI? (Cont.)
    22
    But wait! Let’s see what @jdm said!

    View Slide

  23. How to run tests with Servo CI? (Cont.)
    23

    View Slide

  24. WPT Synchronization
    24
    Sync new /
    fixed tests
    Contribute new
    / fixed tests

    View Slide

  25. 25
    After upstream tests synced
    and try again, finally got
    unexpected PASS!

    View Slide

  26. 26
    Approved by @jdm after the tests marked as PASS

    View Slide

  27. But wait! Why not just merge the PR? and what exactly is
    @bors-servo and r+?
    27

    View Slide

  28. ● What is Servo?
    ● How to contribute?
    ● How to run tests?
    ● How Servo CI works?
    Agenda
    28

    View Slide

  29. Homu: The Not Rocket Science™
    bors is first introduced by Graydon Hoare who is Rust’s original
    creator and mainly applied Ben Elliston’s “not rocket science”
    rule to the bot:
    29
    The Not Rocket Science Rule Of Software Engineering:
    automatically maintain a repository of code that always passes all the tests
    -- Ben Elliston

    View Slide

  30. Homu: The Not Rocket Science™
    30
    Rename fn foo → fn bar
    ✅ CI Pass
    Call fn foo in somewhere
    ✅ CI Pass
    ☠ Function foo doesn’t exist
    ❌ Broken master branch
    A B

    View Slide

  31. Homu: The Not Rocket Science™
    31
    Screenshot from Homu Queue

    View Slide

  32. 32
    @bors-servo with r+ merged PR after
    CI passed

    View Slide

  33. Recap
    33

    View Slide

  34. Recap
    34
    Write
    spec
    compliant
    tests
    Implement
    existing
    /
    new
    spec

    Contribute new / fixed tests

    View Slide

  35. Recap
    35

    Add
    /
    fix
    tests
    while
    changed

    Contribute
    spec
    bugfix
    or
    new
    feature
    Sync new / fixed tests

    View Slide

  36. References
    ● Experience Report: Developing the Servo Web Browser Engine
    using Rust
    ● technicalities: "not rocket science" (the story of monotone and bors)
    ● Rust infrastructure can be your infrastructure
    ● Servo: Designing and Implementing a Parallel Browser
    ● Servo and YOU: A beginner's guide
    ● Inside a super fast CSS engine: Quantum CSS (aka Stylo)
    ● The whole web at maximum FPS: How WebRender gets rid of jank
    36

    View Slide

  37. 37
    https://blog.cybai.dev/
    References

    View Slide

  38. Q & A ?
    38
    We’re hiring!

    View Slide

  39. Thank you!
    @_cybai
    39

    View Slide