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

feat: add clang-uml dependency and test #120

Closed
wants to merge 5 commits into from
Closed

Conversation

BarisTanyeri
Copy link

@BarisTanyeri BarisTanyeri commented Jul 27, 2023

Summary

  • Added clang-uml for UML generation from code
  • Added test for clang-uml and an example
  • Increased clang ubuntu versions from 22.04.02 -> 22.04.03 ( otherwise clang packages are not being seen in apt... )

Example output

image

Why is it closed?

  • clang-uml does not support arm architecture yet.
    ** No arm package available
    ** Building from source fails on arm

@BarisTanyeri BarisTanyeri requested a review from a team as a code owner July 27, 2023 15:08
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Thanks for your first PR. We really appreciate it!

@github-actions
Copy link
Contributor

github-actions bot commented Jul 27, 2023

🦙 MegaLinter status: ❌ ERROR

Descriptor Linter Files Fixed Errors Elapsed time
✅ ACTION actionlint 8 0 0.07s
❌ DOCKERFILE hadolint 1 3 0.37s
✅ JSON eslint-plugin-jsonc 9 0 0 5.32s
✅ JSON prettier 9 2 0 0.61s
✅ JSON v8r 9 0 3.5s
✅ MARKDOWN markdownlint 3 0 0 0.68s
✅ MARKDOWN markdown-link-check 3 0 3.75s
✅ MARKDOWN markdown-table-formatter 3 0 0 0.27s
✅ REPOSITORY checkov yes no 12.84s
✅ REPOSITORY dustilock yes no 0.02s
✅ REPOSITORY gitleaks yes no 0.2s
✅ REPOSITORY git_diff yes no 0.01s
✅ REPOSITORY secretlint yes no 1.12s
✅ REPOSITORY syft yes no 0.3s
❌ REPOSITORY trivy yes 2 5.69s
✅ YAML prettier 10 3 0 0.73s
✅ YAML v8r 10 0 7.42s
✅ YAML yamllint 10 0 0.27s

See detailed report in MegaLinter reports

MegaLinter is graciously provided by OX Security

@@ -1,4 +1,5 @@
{
"software-properties-common" : "0.99.22.7",
Copy link
Contributor

Choose a reason for hiding this comment

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

[MegaLinter] reported by reviewdog 🐶

Suggested change
"software-properties-common" : "0.99.22.7",
"software-properties-common": "0.99.22.7",

Comment on lines +62 to +64
"targets": [
"test-clang-uml"
]
Copy link
Contributor

Choose a reason for hiding this comment

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

[MegaLinter] reported by reviewdog 🐶

Suggested change
"targets": [
"test-clang-uml"
]
"targets": ["test-clang-uml"]

COPY .devcontainer/gcc-${GCC_VERSION}/apt-requirements.json /tmp/apt-requirements-gcc.json

# Skip caching for the next RUN command
ADD "https://www.random.org/cgi-bin/randbyte?nbytes=10&format=h" skipcache

Check notice

Code scanning / Trivy (MegaLinter REPOSITORY_TRIVY)

ADD instead of COPY Low

Artifact: .devcontainer/Dockerfile
Type: dockerfile
Vulnerability DS005
Severity: LOW
Message: Consider using 'COPY "https://www.random.org/cgi-bin/randbyte?nbytes=10&format=h" skipcache' command instead of 'ADD "https://www.random.org/cgi-bin/randbyte?nbytes=10&format=h" skipcache'
Link: DS005
@@ -35,6 +40,8 @@
# Set default generator for CMake to Ninja
ENV CMAKE_GENERATOR="Ninja"

# Skip caching for the next RUN command
ADD "https://www.random.org/cgi-bin/randbyte?nbytes=10&format=h" skipcache

Check notice

Code scanning / Trivy (MegaLinter REPOSITORY_TRIVY)

ADD instead of COPY Low

Artifact: .devcontainer/Dockerfile
Type: dockerfile
Vulnerability DS005
Severity: LOW
Message: Consider using 'COPY "https://www.random.org/cgi-bin/randbyte?nbytes=10&format=h" skipcache' command instead of 'ADD "https://www.random.org/cgi-bin/randbyte?nbytes=10&format=h" skipcache'
Link: DS005
Comment on lines +107 to +117
RUN git clone https://github.com/bkryza/clang-uml \
&& apt-get update && apt-get install -y libclang-${CLANG_VERSION}-dev llvm-${CLANG_VERSION}-dev libclang-cpp${CLANG_VERSION}-dev libsqlite3-dev \
&& cd clang-uml \
&& LLVM_VERSION=${CLANG_VERSION} make release/CMakeLists.txt \
&& cmake --build release --config release --target clang-uml \
&& cmake --install release \
&& cd .. \
&& rm -rf /clang-uml \
&& apt-get purge -y libclang-${CLANG_VERSION}-dev llvm-${CLANG_VERSION}-dev libclang-cpp${CLANG_VERSION}-dev libsqlite3-dev \
&& apt-get autoremove -y \
&& apt-get clean

Check warning

Code scanning / Trivy (MegaLinter REPOSITORY_TRIVY)

'RUN cd ...' to change directory Medium

Artifact: .devcontainer/Dockerfile
Type: dockerfile
Vulnerability DS013
Severity: MEDIUM
Message: RUN should not be used to change directory: 'git clone https://github.com/bkryza/clang-uml && apt-get update && apt-get install -y libclang-${CLANG_VERSION}-dev llvm-${CLANG_VERSION}-dev libclang-cpp${CLANG_VERSION}-dev libsqlite3-dev && cd clang-uml && LLVM_VERSION=${CLANG_VERSION} make release/CMakeLists.txt && cmake --build release --config release --target clang-uml && cmake --install release && cd .. && rm -rf /clang-uml && apt-get purge -y libclang-${CLANG_VERSION}-dev llvm-${CLANG_VERSION}-dev libclang-cpp${CLANG_VERSION}-dev libsqlite3-dev && apt-get autoremove -y && apt-get clean'. Use 'WORKDIR' statement instead.
Link: DS013
Comment on lines +107 to +117
RUN git clone https://github.com/bkryza/clang-uml \
&& apt-get update && apt-get install -y libclang-${CLANG_VERSION}-dev llvm-${CLANG_VERSION}-dev libclang-cpp${CLANG_VERSION}-dev libsqlite3-dev \
&& cd clang-uml \
&& LLVM_VERSION=${CLANG_VERSION} make release/CMakeLists.txt \
&& cmake --build release --config release --target clang-uml \
&& cmake --install release \
&& cd .. \
&& rm -rf /clang-uml \
&& apt-get purge -y libclang-${CLANG_VERSION}-dev llvm-${CLANG_VERSION}-dev libclang-cpp${CLANG_VERSION}-dev libsqlite3-dev \
&& apt-get autoremove -y \
&& apt-get clean

Check failure

Code scanning / Trivy (MegaLinter REPOSITORY_TRIVY)

'apt-get' missing '--no-install-recommends' High

Artifact: .devcontainer/Dockerfile
Type: dockerfile
Vulnerability DS029
Severity: HIGH
Message: '--no-install-recommends' flag is missed: 'git clone https://github.com/bkryza/clang-uml && apt-get update && apt-get install -y libclang-${CLANG_VERSION}-dev llvm-${CLANG_VERSION}-dev libclang-cpp${CLANG_VERSION}-dev libsqlite3-dev && cd clang-uml && LLVM_VERSION=${CLANG_VERSION} make release/CMakeLists.txt && cmake --build release --config release --target clang-uml && cmake --install release && cd .. && rm -rf /clang-uml && apt-get purge -y libclang-${CLANG_VERSION}-dev llvm-${CLANG_VERSION}-dev libclang-cpp${CLANG_VERSION}-dev libsqlite3-dev && apt-get autoremove -y && apt-get clean'
Link: DS029
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.

1 participant