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

Beta tech debt #129

Merged
merged 5 commits into from
Oct 3, 2024
Merged

Beta tech debt #129

merged 5 commits into from
Oct 3, 2024

Conversation

jordanjones243
Copy link
Contributor

@jordanjones243 jordanjones243 commented Oct 2, 2024

Alaska Airlines Pull Request

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Resolves: # (issue, if applicable)

Summary:

Please summarize the scope of the changes you have submitted, what the intent of the work is and anything that describes the before/after state of the project.

Type of change:

Please delete options that are not relevant.

  • New capability
  • Revision of an existing capability
  • Infrastructure change (automation, etc.)
  • Other (please elaborate)

Checklist:

  • My update follows the CONTRIBUTING guidelines of this project
  • I have performed a self-review of my own update

By submitting this Pull Request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Pull Requests will be evaluated by their quality of update and whether it is consistent with the goals and values of this project. Any submission is to be considered a conversation between the submitter and the maintainers of this project and may require changes to your submission.

Thank you for your submission!

-- Auro Design System Team

Summary by Sourcery

Refactor the component registration and dependency management for the auro-flight component, introduce a versioning system for auro-datetime, update documentation to reflect new dependency versions, and clean up GitHub label configurations.

Enhancements:

  • Refactor the component registration process to use a utility function from the Auro library.
  • Introduce a versioning system for the auro-datetime component to manage dependencies more effectively.

Documentation:

  • Update README.md to reflect the new versions of design tokens and web core stylesheets.

Tests:

  • Modify tests to accommodate changes in the auro-datetime component registration and usage.

Chores:

  • Remove unused color attributes from GitHub label configurations in settings.yml.

@jordanjones243 jordanjones243 self-assigned this Oct 2, 2024
@jordanjones243 jordanjones243 linked an issue Oct 2, 2024 that may be closed by this pull request
2 tasks
@jordanjones243 jordanjones243 marked this pull request as ready for review October 3, 2024 16:44
@jordanjones243 jordanjones243 requested a review from a team as a code owner October 3, 2024 16:44
Copy link

sourcery-ai bot commented Oct 3, 2024

Reviewer's Guide by Sourcery

This pull request focuses on technical debt reduction and improvements in the Auro Flight component. The changes include updating dependencies, refactoring code for better maintainability, and improving version management.

Sequence diagram for registerComponent function

sequenceDiagram
    participant RuntimeUtils
    participant AuroFlight
    RuntimeUtils->>AuroFlight: registerComponent('custom-flight', AuroFlight)
Loading

Class diagram for AuroFlight and AuroFlightMain

classDiagram
    class AuroFlight {
        +AuroLibraryRuntimeUtils runtimeUtils
        +firstUpdated()
    }
    class AuroFlightMain {
        +AuroDependencyVersioning versioning
        +String datetimeTag
    }
    AuroFlightMain --> AuroDependencyVersioning
    AuroFlight --> AuroLibraryRuntimeUtils
Loading

File-Level Changes

Change Details Files
Removed color definitions from GitHub labels
  • Removed color property from multiple label definitions in the GitHub settings file
.github/settings.yml
Refactored component registration process
  • Removed custom registerComponent function
  • Implemented RuntimeUtils for component registration
index.js
Updated auro-flight-main component
  • Changed 'arrivalTime' attribute to 'da'
  • Implemented versioning for auro-datetime component
  • Updated usage of auro-datetime to use dynamic tag name
src/auro-flight-main.js
Added runtime utilities to auro-flight component
  • Added constructor with runtimeUtils initialization
  • Implemented handleComponentTagRename in firstUpdated lifecycle method
src/auro-flight.js
Updated tests for auro-flight-main
  • Modified selectors to accommodate dynamic auro-datetime tag name
test/auro-flight-main.test.js
Updated dependency versions in README
  • Updated design-tokens version to 4.9.2
  • Updated webcorestylesheets version to 5.1.2
README.md
Removed auro-datetime script from demo files
  • Removed script tag for auro-datetime from api.html and index.html
demo/api.html
demo/index.html
Added version file for datetime component
  • Created new file datetimeVersion.js with version 2.2.0
src/datetimeVersion.js

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.

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

@jordanjones243 jordanjones243 merged commit 33a189b into beta Oct 3, 2024
4 checks passed
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @jordanjones243 - I've reviewed your changes - here's some feedback:

Overall Comments:

  • The removal of color definitions for labels in settings.yml seems unusual. Could you provide the reasoning behind this change?
  • The change of the 'arrivalTime' attribute to 'da' in auro-flight-main.js might break existing implementations. Is this intentional, and if so, how will backward compatibility be maintained?
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟡 Testing: 2 issues found
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

console.log("this:", el.shadowRoot.querySelector('.departureTime'));

await expect(el.shadowRoot.querySelector('.departureTime').querySelector('[auro-datetime]').getAttribute('setDate')).to.equal('2022-05-04T00:30:00-07:00');
await expect(el.shadowRoot.querySelector('.arrivalTime').querySelector('[auro-datetime]').getAttribute('setDate')).to.equal('2022-05-04T11:55:00-04:00');
Copy link

Choose a reason for hiding this comment

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

suggestion (testing): Update test selectors to match new dynamic datetime tag implementation

The test has been updated to use attribute selectors instead of element selectors for the datetime component. This change aligns with the new dynamic tag generation in the component. However, we should consider adding more test cases to ensure the dynamic tag generation works correctly for different versions.

Suggested change
await expect(el.shadowRoot.querySelector('.arrivalTime').querySelector('[auro-datetime]').getAttribute('setDate')).to.equal('2022-05-04T11:55:00-04:00');
<auro-flight-main departureTime="2022-05-04T00:30:00-07:00" departureStation="SEA" arrivalTime="2022-05-04T11:55:00-04:00" arrivalStation="PVD" flights='["AS 1436"]' reroutedArrivalStation="SFO" reroutedDepartureStation="LAX"></auro-flight-main>
`);
await expect(el.shadowRoot.querySelector('.departureTime [auro-datetime]').getAttribute('setDate')).to.equal('2022-05-04T00:30:00-07:00');
await expect(el.shadowRoot.querySelector('.arrivalTime [auro-datetime]').getAttribute('setDate')).to.equal('2022-05-04T11:55:00-04:00');
// Additional test for dynamic tag generation
await expect(el.shadowRoot.querySelector('.departureTime [auro-datetime]').tagName.toLowerCase()).to.match(/^auro-datetime(-[\d.]+)?$/);
await expect(el.shadowRoot.querySelector('.arrivalTime [auro-datetime]').tagName.toLowerCase()).to.match(/^auro-datetime(-[\d.]+)?$/);

console.log("this:", el.shadowRoot.querySelector('.departureTime'));

await expect(el.shadowRoot.querySelector('.departureTime').querySelector('[auro-datetime]').getAttribute('setDate')).to.equal('2022-05-04T00:30:00-07:00');
await expect(el.shadowRoot.querySelector('.arrivalTime').querySelector('[auro-datetime]').getAttribute('setDate')).to.equal('2022-05-04T11:55:00-04:00');
await expect(el.shadowRoot.querySelector('.departureStation').textContent.trim()).to.contain('SEA');
await expect(el.shadowRoot.querySelector('.arrivalStation').textContent.trim()).to.contain('PVD');
});
Copy link

Choose a reason for hiding this comment

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

suggestion (testing): Add tests for new functionality

The PR introduces new functionality such as dynamic tag generation and handling of component tag renaming. Consider adding new test cases to cover these changes, ensuring that the new features work as expected.

  });

  it('should dynamically generate tags based on component properties', async () => {
    const el = await fixture(html`<auro-flight-main></auro-flight-main>`);
    el.tagName = 'custom-tag';
    await el.updateComplete;
    expect(el.shadowRoot.querySelector('custom-tag')).to.exist;
  });

  it('should handle component tag renaming correctly', async () => {
    const el = await fixture(html`<auro-flight-main></auro-flight-main>`);
    el.tagName = 'new-tag';
    await el.updateComplete;
    expect(el.shadowRoot.querySelector('new-tag')).to.exist;
    expect(el.shadowRoot.querySelector('auro-flight-main')).to.not.exist;
  });

@jordanjones243 jordanjones243 deleted the jjones/betaTechDebt branch October 3, 2024 16:46
@blackfalcon
Copy link
Member

🎉 This PR is included in version 3.0.0-beta.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

Update color tokens for theming support
2 participants