Commit Graph
42 Commits
Author SHA1 Message Date
Matt Godbolt f1e930b7fc Decommision the "AWS" magic compiler name (#7321)
Nothing was using it, we're using other methods these days to discover
remote compilers (and have been for years), and it was broken (see
#1790).

Also cleans up some config (moving it from aws to ceProps; though it was
unused, default used only), and also some workarounds for remote
compilers that refer back to the MS compiler era (#1768).

This leaves the ability in `aws.ts` to fetch instances in case we ever
need the functionality, as this is tested and still works.

Closes #1790
2025-01-29 08:36:01 -06:00
Atharva Rai a3c64dc4dc Remove body-parser dependency (#7176)
This PR addresses issue #7158 by removing the body-parser dependency in
favor of express.json() and other built-in middleware functionalities
provided by Express.js.
2024-12-07 01:47:06 +09:00
Mats Jun Larsen 630015c3f3 Remove addStaticHeaders and contentPolicyHeader functions (#7159)
Stops passing these functions around and instead configures the headers
by chaining express handlers
2024-12-01 16:22:41 +09:00
Mats Jun Larsen e03f3d058c Remove old shortener path (#7160)
This has been dangling as a TODO from @mattgodbolt since 2021. Running
the following Athena query:

```sql
SELECT COUNT(*) as reqs, uri, date
from cloudfront_logs
WHERE uri LIKE '/shortener%'
GROUP BY date, uri
```

Yields about 8-20 requests per day. I think this is an insignificant
enough amount of traffic to justify removing it now.
2024-12-01 10:07:45 +09:00
Mats Jun Larsen fba4ba672a De-couple formatter from http server (#7155)
This patch decouples the formatting logic (which is used by the
clang-format feature) from the http API logic.

This is done with the new FormattingService populates the formatters
from the config, and wraps formatter execution. This way, both the http
controller and the clang-format functionality can use it, reducing tight
coupling.
2024-11-30 12:14:11 +09:00
Mats Jun Larsen 3b695d0469 Hoist healthcheck router above logging middleware (#7157)
Fixes #7156
2024-11-30 11:49:26 +09:00
Mats Jun Larsen 788e576762 Add controller for healthcheck endpoint (#7145)
Follow up to building separate express routers for each domain. Now
handles the healthcheck in a separate controller
2024-11-29 01:06:50 +09:00
Mats Jun Larsen eb45763ff0 Add correct types to healthcheck endpoints (#7144)
Removes the any types and properly types the option
2024-11-29 00:24:04 +09:00
Mats Jun Larsen b29a0809ad Introduce HttpController interface for http routers (#7142)
By requiring controllers to declare their own routes, we ensure
consistency between tests and the actual server
2024-11-29 00:12:06 +09:00
Mats Jun Larsen 52e27d5a37 Rewrite assembly documentation handler to controller form (#7130)
Follow-up to #7090
2024-11-28 22:39:10 +09:00
Mats b09b027201 Add controller for site templates (#7131)
Equivalent of #7130 for site templates
2024-11-28 21:55:39 +09:00
Mats ea29a6e9d6 Separate list and load actions for source API (#7090)
This is the first PR in API consistency with more to come:

1. The source API urls have been properly defined with
`/source/:source/list` and `/source/:source/load/:language/:filename`
- These used to be two API endpoints mushed together into one `handle()`
function. They are now separate
- While it may appear from the tests that this is an API breakage,
there's currently no way to have the source API spit out responses for
stuff like `/source/moose/load/Grunkle`.
2. The frontend code calling the list api now has shared types
3. Code has been migrated to `/lib/handlers/api/source.ts`
- I've moved code here, because I would like to separate the stuff
that's under the API and the stuff that isn't (e.g., healthcheck)
- The source endpoint is currently not under /api, but I believe it
makes sense to move it.
4. GitHub is terrible at showing the diff, but the `browser.ts` file has
been removed, since it's never actually used. Our frontend only calls
`/source/builtin/...` and it never had any entries. Besides, the type
used on the frontend for the locally stored stuff is different...
2024-11-27 13:54:47 +09:00
Mats Jun 73ee43da66 Handle site template importing asynchronously (#7089)
1. Gives a proper type to the metadata
2. Fixes a typo in `screenshot_dimentions`
3. Removes home-made partition function in favor of underscore
4. Reads file asynchronously (and consequently rest of API is async)
5. Strips the `https://godbolt.org/#` from each entry in the config file

As an added benefit this should also cut some startup time reading this
file before it's used :)
2024-11-15 10:03:12 +09:00
Matt Godbolt 84b8f116ad Support multiple --language arguments (#7075)
Still supports comma-separated languages.

See
https://github.com/compiler-explorer/compiler-explorer/discussions/7074
2024-11-09 10:27:16 -06:00
Ofek 63dd5e35a5 Various tsifications (#7025) 2024-10-27 15:28:38 +02:00
Patrick Quist 4fe8397fac Remote execution (#6700) 2024-10-26 17:42:22 +02:00
Ofek 4e5348ab77 Tsify tools (mostly) (#7018)
This includes among others:
 - Proper tsification of various tools code,
 - Elimination of the `CompilationInfo2` type,
 - Use of `CompilationInfo` instead of `Record<any, any>` in some places
 - These lines in CompilationResult:
```
    // Temp hack until we get all code to agree on type of asm
    asm?: ResultLine[] | string;
```

The next task would be to get all code to agree on the type of
CompilationResult.asm, thereby enabling fixing of most the remaining
TSification.
2024-10-26 10:58:30 +03:00
Mats Jun cc9de7e478 Remove legacy non-existing monaco worker route (#6995)
_No functional change intended_

According to
https://github.com/compiler-explorer/compiler-explorer/commit/7ce90a33884e0a89ca14ba261be8caf47b9122ce
and
https://github.com/compiler-explorer/compiler-explorer/commit/0d0a52e249b18fe9363283bec3a6cab720fa8fb4
the route was added a very long time ago (4-5 years) to support compat
for workers downloaded to the user's browsers.

In addition to this being very long ago to the point that the chance of
anybody having an old CE worker being extremely low, those files no
longer exist.

We tag our webpack bundles with a "magic version" (current .v53.) to
force the browsers to re-fetch the bundles for major changes. That means
that if somebody had `editor.v10.worker.[hash].js` from years ago, that
file won't even be in our current bundle, and has to be in their
browser's cache (unlikely because it's so old, but even then their
browser wouldn't hit this route due to cache)
2024-10-22 21:39:15 +09:00
Ofek f715dc2932 More tsification (#6877)
About half way through. Only 708 tsification errors to go..
2024-09-28 10:32:36 +03:00
Ofek 9ef46fbafe Binge of (mostly) mindless tsification (#6838)
Turned on `noImplicitAny` in tsconfig, then went around fixing some
random easy stuff.
Hopefully tsification-PRs with more real content coming up.
2024-09-07 14:36:43 +03:00
Patrick Quist 75acc5bd44 Attempt to detect faulty compiler/language population (#6610) 2024-07-07 13:09:51 +02:00
Patrick Quist d2c7a5222e Local/Remote Execution environment (#6413) 2024-05-26 22:09:01 +02:00
Matt Godbolt f358067cec Migrate to eslint-plugin-n; as ...-node is deprecated (#6387)
Replaces #6310
2024-04-23 06:45:55 -05:00
Matt Godbolt 613d7f688a Unify the way tmp dir is used (#6052)
Instead of having several globals, set via environment variables,
explicitly set the "correct" env var if passed `--tmpDir` and then
consistently use it in the rest of the program.

See @apmorton's comments in #1707
2024-01-28 18:50:46 -06:00
Jeremy Rifkin c43e69bfdd Use CompilerInfo[] in a couple places that were previously any or never (#6029)
Depends on #6028
2024-01-22 21:47:45 -06:00
Jeremy Rifkin e5fb8e1afc Improve typings for the now-global HandlerConfig (#6027)
This PR populates types in the HandlerConfig
2024-01-21 10:29:58 -06:00
Ofek 21fe5523c0 Since ES6 there's no reason to use underscores map and filter (#5989)
Mindless replacements of the form 
`_.filter(options, option =>...`  --> `options.filter(option =>...`.

One not *entirely* mindless replacement at the bottom of
compiler-dropin-tool.ts :
```
-        return _.filter(pathFilteredFlags) as string[];
+        return pathFilteredFlags.filter(Boolean) as string[];
```
6 files can now stop importing underscore.
2024-01-13 18:35:11 +02:00
kevinjeon-g fb0f0a86d9 Add the HandlerConfig type to the global handler config (#5858) 2023-12-10 14:03:34 -06:00
kevinjeon-g 7efe253f5f Add support for Android D8 (8.1.56) (#5756)
Adds D8Compiler, which applies to the Android Java and Android Kotlin
languages. D8Compiler instantiates a JavaCompiler or KotlinCompiler
using the java/kotlin dependencies' paths for D8 in the infra repo.

compiler-finder.ts has been updated to allow for duplicate compiler IDs
for 'android-java' and 'android-kotlin', as it is expected that the
compilers used for these languages is the same.
2023-12-04 19:35:56 -06:00
Jeremy Rifkin fb147126e8 Fix WSL for systems that don't have windows paths (#5480)
Attempt to fix #5476. As far as I can tell `process.env.winTmp` is
needed just for windows executables and WslVcCompiler. It should be
possible to just ignore the exec error and continue. If for some reason
the user doesn't have windows paths in their WSL but does want to run
windows executables they can pass `-tmpDir`.
2023-09-16 15:59:26 -04:00
Jeremy 2a3c1738d8 Hotfix for WSL2 detection 2023-08-20 15:57:06 -04:00
Jeremy Rifkin 4260313e13 Common utilities and type work (#5200)
This PR refactors some common utilities out of lib/ and into shared/ and
eliminates some use of underscore.js, as well as general type
improvements done along the way.
2023-06-28 20:13:10 -04:00
Jeremy Rifkin acdd5ad45c Capture errors in sentry better (#5128)
Fixes #5127 and similar issues.

Rationale: Whenever something that is not an Error object is passed to
Sentry.captureException we get pretty much no useful information in
sentry

![image](https://github.com/compiler-explorer/compiler-explorer/assets/51220084/c7345449-f7a0-46cb-a198-abe0bd80a8b1)
(usually not even a stacktrace)
2023-06-11 17:31:51 -04:00
Matt Godbolt 4187390952 Update eslint et al (#5115) 2023-06-06 21:17:25 -05:00
Patrick Quist a08f6957f4 add option for custom papertrail hostname (#4912) 2023-03-30 23:44:19 +02:00
Patrick Quist 7d192ccde1 add properties and test for cewrapper (#4761) 2023-03-18 11:46:27 +01:00
Matt Godbolt a8f832f80c Bump to latest cypress (#4853)
Latest cypress:
- updated all the tests
- fixed up warnings
- got rid of isolation stuff, it's now isolated by default
- added simple docs
- added `--noLocal` to prevent any local config from screwing up when
testing locally
- store screenshot artifacts if things go wrong
2023-03-14 10:00:40 -05:00
Matt Godbolt 7d97269f49 npm format 2023-03-07 17:35:24 -06:00
Matt Godbolt 5401024e26 Fix static file serving 2023-03-07 17:29:43 -06:00
Matt Godbolt d14d338fa9 Update all non-critical packages (#4824)
eslint, nopt, url-join and sinon. All seem OK and nothing scary in
release notes.
2023-03-07 17:18:46 -06:00
Mats Jun LarsenandMatt Godbolt 633eb82d18 Transition to ECMAScript Modules (#4780)
Makes the Compiler Explorer app, and all the tooling ESM compatible.
Things that have been done:

1. The package.json has `type: module` now
2. All relative imports have a .js ending
3. All directory imports are now directory/index.js to comply with ESM
standards
4. Dependency node-graceful is now imported into tree, because the
package is broken under esm
5. Dependency p-queue has been bumped to 7.x with ESM support
6. Dependency profanities has been bumped to 3.x with ESM support
7. Webpack config is now both ESM and CommonJS compatible
8. Non-ESM compatible imports have been rewritten
9. ESLint configuration has been tweaked to not fail on .js imports
10. Mocha is now hacked together and ran with ts-node-esm
11. Webpack is now hacked together and ran with ts-node-esm
12. Webpack config is now ESM compatible, so that it can be used in the
dev server
13. Cypress code still runs commonjs, and has been excluded from the
tsconfig
14. All sinon mock tests have been commented out, because sinon module
mocks do not work with ESModules (because ESModules are immutable)

A lot of tests are now giving warnings/errors to stdout, yet still pass.
Docenizer codegenerator scripts have been updated, but I did not re-run
them, and instead just changed their code.

---------

Co-authored-by: Matt Godbolt <matt@godbolt.org>
2023-02-27 18:06:38 -06:00
Jeremy Rifkin 6bd5c43f62 Tsify app.js (#4767)
I forgot about app.js, now this is actually the last file in our ts
conversion (other than test/)
2023-02-23 17:15:59 -05:00