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

Upgrade codebase to .NET6 and re-factor dependencies (1 of 3) #35

Merged

Conversation

travisnielsen
Copy link
Contributor

This PR replaces the C# Script (CSX) build process with a standard .NET6 project and removes dependencies on rsvg and inkscape. PNG files are now generated using Playwright, which will result in much better consistency.

  • Addresses Corrupted icons #32. All icons captured in this issue are now render correctly. SVGs are converted to PNG via Playwright.
  • Externalized config settings (file paths), which addresses Hard Coded Paths In Build Scripts #9
  • Code has been re-platformed to a .NET6 project. Playwright requires a .csproj file.
  • Initial re-factoring
  • Build process now works fully on MacOS, Linux, and (of course) Windows.
  • Added a code dependency on svg-net for setting SVG height, width, viewbox, and aspect ratio. This could be eliminated in the future.
  • Updated build documentation

@travisnielsen
Copy link
Contributor Author

@Potherca just curious to know about any plans to review / merge this PR and the two that follow it. Are we looking for more reviewers?

@Potherca
Copy link
Member

One reviewer is fine for now. At this point it is waiting for me or @RicardoNiepel to review the MRs.

Sadly my planning is currently dominated by homeschooling my children, as we are stuck in self-quarantine because one of my daughters has COVID. I'm hoping to find some time during the week, but it could be at a standstill for another week. 😞

@travisnielsen
Copy link
Contributor Author

OK - no worries. Best wishes on your daughter's recovery!

@travisnielsen
Copy link
Contributor Author

Hi @Potherca - Any plans to review these PRs?

@Potherca Potherca self-assigned this May 26, 2022
Copy link
Member

@Potherca Potherca left a comment

Choose a reason for hiding this comment

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

I finally found some time to review this.

Everything looks alright. Some files are missing newline at end-of-file. I'll add those.

I'll run the code locally (I'm on Linux), after that, this can be merged.

scripts/Program.cs Outdated Show resolved Hide resolved
scripts/lib/IImageManager.cs Outdated Show resolved Hide resolved
scripts/lib/Util.cs Outdated Show resolved Hide resolved
@Potherca
Copy link
Member

Potherca commented Jul 3, 2022

Some observations of local run, @travisnielsen, could you take a look?:

  • The README mentions a appsettings.example but no such file seems to be comitted?

  • Things seem to work

  • I'm seeing a lot of Missing [..] color or mono Errors

  • There are timeout for several sprites, combined with (No such file or directory):

    fail: SvgManager[0]
          Failed to export png ../dist/Web/AzureSignalRService(m).svg  Message: Timeout 30000ms exceeded.
          =========================== logs ===========================
          taking element screenshot
            waiting for element to be visible and stable
              element is not visible - waiting...
          ============================================================
    Exception in thread "main" java.io.FileNotFoundException: /home/ben/Dropbox/Work/plantuml-stdlib/azure-plantuml/scripts/../dist/Web/AzureSignalRService(m).png (No such file or directory)
        at java.base/java.io.FileInputStream.open0(Native Method)
        at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
        at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
        at java.base/java.io.FileInputStream.<init>(FileInputStream.java:112)
        at java.base/sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:86)
        at java.base/sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:184)
        at java.base/java.net.URL.openStream(URL.java:1165)
        at net.sourceforge.plantuml.Run.encodeSprite(Run.java:299)
        at net.sourceforge.plantuml.Run.main(Run.java:122)
    
  • The install sections for Linux mentions a custom ppa, but sudo apt-get install -y libgdiplus worked fine with the official package, no PPA needed. Should that section be removed?

  • The Playwright CLI complained the Playwright was not installed.
    Nevermind. Looks like I ran Playwright-CLI before the dependencies were installed. 🤦

@Potherca Potherca linked an issue Jul 3, 2022 that may be closed by this pull request
@travisnielsen
Copy link
Contributor Author

travisnielsen commented Jul 23, 2022

Thanks for the review @Potherca ! I think I have addressed all the items from your testing:

  • Removed reference to appsettings.example
  • Addressed Missing [..] color or mono errors. That was due to case sensitivity in Linux (good catch!). There is still one error for Azure Data Lake Analytics but that's legit and the icon should be removed from config.yaml in a future pull request.
  • Fixed timeouts. Issue was caused by invalid xmlns attributes in the svg element in the source SVG. This prevents it from being visible in Playwright (or any browser for that matter). Added error handling to clearly state the issue if it happens with future icons.
  • Removed instructions for libgdiplus setup on Linux. It's no longer required because I removed the dependency on the svg-net library.

@Potherca
Copy link
Member

Potherca commented Aug 1, 2022

I've updated my branch locally and run the code again.Everything seems to work just fine! 👍

There are some errors and warnings, but those are all application owned.

All errors and warnings
  • Error: Missing Azure Data Lake Analytics color or mono

  • Fail: Invalid svg namespace attribute.Confirm file has xmlns='http://www.w3.org/2000/svg' in the svg element.

    • source/manual/Azure-Batch-AI_COLOR.svg.
    • source/manual/Azure-SignalR-Service_COLOR.svg.
  • Warning: File found in multiple locations

    • API Management Services
      • source/official/integration/10042-icon-service-API-Management-Services.svg
      • source/official/app services/10042-icon-service-API-Management-Services.svg
    • Application Insights
      • source/official/devops/00012-icon-service-Application-Insights.svg
      • source/official/management + governance/00012-icon-service-Application-Insights.svg
    • App Services
      • source/official/containers/10035-icon-service-App-Services.svg
      • source/official/app services/10035-icon-service-App-Services.svg
      • source/official/compute/10035-icon-service-App-Services.svg
    • Azure Synapse Analytics
      • source/official/databases/00606-icon-service-Azure-Synapse-Analytics.svg
      • source/official/analytics/00606-icon-service-Azure-Synapse-Analytics.svg
    • Batch Accounts
      • source/official/containers/10031-icon-service-Batch-Accounts.svg
      • source/official/compute/10031-icon-service-Batch-Accounts.svg
    • CDN Profiles
      • source/official/app services/00056-icon-service-CDN-Profiles.svg
      • source/official/networking/00056-icon-service-CDN-Profiles.svg
    • CDN Profiles
      • source/official/app services/00056-icon-service-CDN-Profiles.svg
      • source/official/networking/00056-icon-service-CDN-Profiles.svg
    • Container Instances
      • source/official/containers/10104-icon-service-Container-Instances.svg
      • source/official/compute/10104-icon-service-Container-Instances.svg
    • Cost Management And Billing
      • source/official/migrate/00004-icon-service-Cost-Management-and-Billing.svg
      • source/official/management + governance/00004-icon-service-Cost-Management-and-Billing.svg
      • source/official/general/00004-icon-service-Cost-Management-and-Billing.svg
    • Data Box Edge
      • source/official/storage/10095-icon-service-Data-Box-Edge.svg
      • source/official/migrate/10095-icon-service-Data-Box-Edge.svg
    • Data Box
      • source/official/storage/10094-icon-service-Data-Box.svg
      • source/official/migrate/10094-icon-service-Data-Box.svg
    • Event Hubs
      • source/official/iot/00039-icon-service-Event-Hubs.svg
      • source/official/analytics/00039-icon-service-Event-Hubs.svg
    • Function Apps
      • source/official/iot/10029-icon-service-Function-Apps.svg
      • source/official/compute/10029-icon-service-Function-Apps.svg
    • Instance Pools
      • source/official/databases/10139-icon-service-Instance-Pools.svg
      • source/official/other/10139-icon-service-Instance-Pools.svg
    • Kubernetes Services
      • source/official/containers/10023-icon-service-Kubernetes-Services.svg
      • source/official/compute/10023-icon-service-Kubernetes-Services.svg
    • Log Analytics Workspaces
      • source/official/management + governance/00009-icon-service-Log-Analytics-Workspaces.svg
      • source/official/analytics/00009-icon-service-Log-Analytics-Workspaces.svg
    • Logic Apps
      • source/official/iot/10201-icon-service-Logic-Apps.svg
      • source/official/internet of things/02631-icon-service-Logic-Apps.svg
      • source/official/integration/10201-icon-service-Logic-Apps.svg
    • Notification Hubs
      • source/official/iot/10045-icon-service-Notification-Hubs.svg
      • source/official/app services/10045-icon-service-Notification-Hubs.svg
    • Notification Hubs
      • source/official/iot/10045-icon-service-Notification-Hubs.svg
      • source/official/app services/10045-icon-service-Notification-Hubs.svg
    • Recovery Services Vaults
      • source/official/storage/00017-icon-service-Recovery-Services-Vaults.svg
      • source/official/migrate/00017-icon-service-Recovery-Services-Vaults.svg
      • source/official/management + governance/00017-icon-service-Recovery-Services-Vaults.svg
    • Service Fabric Clusters
      • source/official/containers/10036-icon-service-Service-Fabric-Clusters.svg
      • source/official/compute/10036-icon-service-Service-Fabric-Clusters.svg
    • SQL Data Warehouses
      • source/official/databases/00036-icon-service-SQL-Data-Warehouses.svg
      • source/official/integration/00036-icon-service-SQL-Data-Warehouses.svg
    • SQL Data Warehouses
      • source/official/databases/00036-icon-service-SQL-Data-Warehouses.svg
      • source/official/integration/00036-icon-service-SQL-Data-Warehouses.svg
    • Stream Analytics Jobs
      • source/official/iot/00042-icon-service-Stream-Analytics-Jobs.svg
      • source/official/analytics/00042-icon-service-Stream-Analytics-Jobs.svg

@Potherca Potherca added this to the v2.2.0 milestone Aug 1, 2022
@Potherca
Copy link
Member

Potherca commented Aug 1, 2022

@travisnielsen I am all set to merge this. Is there anything that needs to be done before I do so?

After the merge #36 and #37 can be updated / rebased / rerun / etc. and then be merged as well.

Thank you again for all your effort and patience to make this happen!

@travisnielsen
Copy link
Contributor Author

@travisnielsen I am all set to merge this. Is there anything that needs to be done before I do so?

Nope. We should be good to proceed with the merge!

After the merge #36 and #37 can be updated / rebased / rerun / etc. and then be merged as well.

Yep. I'll rebase the other two branches after the merge to main. Those should go much more quickly since they don't involve code changes.

@Potherca Potherca merged commit e38467c into plantuml-stdlib:master Aug 2, 2022
@travisnielsen travisnielsen deleted the feature/buildscriptupdate branch August 2, 2022 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Hard Coded Paths In Build Scripts
2 participants