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

(Partially) Fix #2100: add cache slugs. #2208

Merged
merged 34 commits into from
Jul 23, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
126df37
Added cache slugs for images and modified all references to the images.
gvishal Jul 2, 2016
8125aa9
Added interpolation service to get static image url, modified non-pag…
gvishal Jul 3, 2016
e0f0ff3
Modified /script tags
gvishal Jul 3, 2016
7e5a68f
Added cache slugs for i18n
gvishal Jul 3, 2016
5be7fdd
Fixed failing test and added i18n/prod to git ignore.
gvishal Jul 5, 2016
d9e18a4
Cache slugs new approach POC
gvishal Jul 9, 2016
35bb24b
Modified references for images, scripts and i18n.
gvishal Jul 9, 2016
10df46d
Modified gulp file and references to oppia.css and third_party css an…
gvishal Jul 10, 2016
77da86a
Added slugs to extensions
gvishal Jul 10, 2016
1350392
Fixed test for get_cache_slug
gvishal Jul 12, 2016
4b49a9b
Modified build.py and deploy.py
gvishal Jul 12, 2016
1d3c232
Addressed review comments
gvishal Jul 13, 2016
60f33a4
Modify imports
gvishal Jul 13, 2016
5f8bf7f
Modified src to ng-src and other review comments fixed.
gvishal Jul 15, 2016
9d85731
Modified build.py
gvishal Jul 15, 2016
48c4039
Minor change
gvishal Jul 15, 2016
883e1c5
Removed feconf.CACHE_SLUG_DEV and refactored
gvishal Jul 16, 2016
aa4be4e
Added random cache slug
gvishal Jul 16, 2016
b165745
Refactored code.
gvishal Jul 16, 2016
88c91e7
Modified references for extensions, added extensions to build process…
gvishal Jul 17, 2016
bbc31fb
Merge remote-tracking branch 'upstream/develop' into implement-cache-…
gvishal Jul 17, 2016
9daa7b0
Fixed bug
gvishal Jul 17, 2016
89a0196
Addressed review comments.
gvishal Jul 18, 2016
c5aa6c6
Fix failing tests
gvishal Jul 19, 2016
1312642
Fixed bug.
gvishal Jul 19, 2016
55d1b29
Added tests for urlinterpolationservice.
gvishal Jul 19, 2016
f8d95ed
Added interpolation for interactions and logic_proof.html
gvishal Jul 20, 2016
57f6fdb
Merge remote-tracking branch 'upstream/develop' into implement-cache-…
gvishal Jul 20, 2016
8cb8624
Addressed review comments
gvishal Jul 21, 2016
eeb9b5b
Addressed review comments
gvishal Jul 22, 2016
74781cb
Removed unnecessary include from templates
gvishal Jul 22, 2016
238c896
Merge branch 'develop' into implement-cache-slugs-2100
gvishal Jul 23, 2016
ad26ae9
Modified precommit linter script to fix endless waiting
gvishal Jul 23, 2016
3b83d27
Commented script and added assets/scripts to exclusions.
gvishal Jul 23, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Modified /script tags
  • Loading branch information
gvishal committed Jul 3, 2016
commit e0f0ff33fc50d0be638042c7bb93ffe1d5019663
4 changes: 2 additions & 2 deletions core/templates/dev/head/player/ConversationSkinDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,14 +258,14 @@ oppia.directive('conversationSkin', [function() {
'LearnerViewRatingService', 'windowDimensionsService',
'playerTranscriptService', 'LearnerParamsService',
'playerPositionService', 'explorationRecommendationsService',
'StatsReportingService',
'StatsReportingService', 'UrlInterpolationService',
function(
$scope, $timeout, $rootScope, $window, $translate,
messengerService, oppiaPlayerService, urlService, focusService,
LearnerViewRatingService, windowDimensionsService,
playerTranscriptService, LearnerParamsService,
playerPositionService, explorationRecommendationsService,
StatsReportingService) {
StatsReportingService, UrlInterpolationService) {
$scope.CONTINUE_BUTTON_FOCUS_LABEL = 'continueButton';
// The exploration domain object.
$scope.exploration = null;
Expand Down
3 changes: 2 additions & 1 deletion core/tests/protractor_utils/general.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ var EDITOR_URL_SLICE = '/create/';
var PLAYER_URL_SLICE = '/explore/';
var LOGIN_URL_SUFFIX = '/_ah/login';
var ADMIN_URL_SUFFIX = '/admin';
var SCRIPTS_URL_SLICE = '/scripts/';
// TODO(gvishal): update for prod as well.
Copy link
Member

Choose a reason for hiding this comment

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

Protractor tests always run on dev though, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I noticed that in deploy.py, after processing all the files we execute all the tests, which would probably run on dev? is that ryt? Would we wanna run tests on a simulated prod server?

Copy link
Member

Choose a reason for hiding this comment

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

mm, good question. We are actually considering removing that because in practice travis will already have done that. So, I think it's ok to run on dev -- as long as travis checks pass, things are fine. We'll deal with prod later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

so, remove the TODO?

Copy link
Member

Choose a reason for hiding this comment

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

Maybe change it to a comment: "Note that this only works in dev, due to the use of cache slugs in prod".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added

var SCRIPTS_URL_SLICE = '/static/dev/scripts/';
var EXPLORATION_ID_LENGTH = 12;

var FIRST_STATE_DEFAULT_NAME = 'Introduction';
Expand Down
2 changes: 1 addition & 1 deletion static/dev/scripts/README
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ them. To load the examples manually you need to:
- In a browser window, open each of the HTML files in this folder, and ensure
that they do the correct thing. Use URLs of the following form:

http://localhost:8181/scripts/embedding_tests_dev_0.0.1.html
http://localhost:8181/static/dev/scripts/embedding_tests_dev_0.0.1.html


The features supported in each version of the embedding script are as follows:
Expand Down
10 changes: 5 additions & 5 deletions static/dev/scripts/embedding_tests_dev_0.0.0.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<h2>v0.0.0</h2>
<p>For instructions: see the README file in /static/scripts.</p>
<p>For instructions: see the README file in /static/dev/scripts.</p>

<h3>Standard embedding of the latest version</h3>
<oppia oppia-id="0"></oppia>
<script src="http://localhost:8181/scripts/oppia-player-0.0.0.js"></script>
<script src="http://localhost:8181/static/dev/scripts/oppia-player-0.0.0.js"></script>

<h3>Standard embedding of version 1 of the exploration</h3>
<oppia oppia-id="0" exploration-version="1"></oppia>
<script src="http://localhost:8181/scripts/oppia-player-0.0.1.js"></script>
<script src="http://localhost:8181/static/dev/scripts/oppia-player-0.0.1.js"></script>

<h3>ERROR: No oppia id specified</h3>
<oppia></oppia>
<script src="http://localhost:8181/scripts/oppia-player-0.0.0.js"></script>
<script src="http://localhost:8181/static/dev/scripts/oppia-player-0.0.0.js"></script>

<h3>ERROR: 404 error</h3>
<oppia oppia-id="fake_id"></oppia>
<script src="http://localhost:8181/scripts/oppia-player-0.0.0.js"></script>
<script src="http://localhost:8181/static/dev/scripts/oppia-player-0.0.0.js"></script>
8 changes: 4 additions & 4 deletions static/dev/scripts/embedding_tests_dev_0.0.1.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<h2>v0.0.1 (unminified)</h2>
<p>For instructions: see the README file in /static/scripts.</p>
<p>For instructions: see the README file in /static/dev/scripts.</p>
<p>
NB: When you complete an exploration the text "Exploration completed" should
appear in the paragraph below it. This checks that events are being sent from
the Oppia iframe to the containing page.
</p>

<script src="/scripts/oppia-player-0.0.1.js"></script>
<script src="/scripts/embedding_tests.js"></script>
<script src="/static/dev/scripts/oppia-player-0.0.1.js"></script>
<script src="/static/dev/scripts/embedding_tests.js"></script>

<div class="protractor-test-standard">
<h3>Standard embedding of the latest version</h3>
Expand All @@ -32,4 +32,4 @@ <h3>ERROR: 404 error</h3>
<div class="protractor-test-invalid-id-deferred">
<h3>ERROR: 404 error with deferred loading</h3>
<oppia oppia-id="fake_id" autoload="false"></oppia>
</div>
</div>
6 changes: 3 additions & 3 deletions static/dev/scripts/embedding_tests_dev_0.0.1.min.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<h2>v0.0.1 (minified)</h2>
<p>For instructions: see the README file in /static/scripts.</p>
<p>For instructions: see the README file in /static/dev/scripts.</p>
<p>
NB: When you complete an exploration the text "Exploration completed" should
appear in the paragraph below it. This checks that events are being sent from
the Oppia iframe to the containing page.
</p>

<script src="/scripts/oppia-player-0.0.1.js"></script>
<script src="/scripts/embedding_tests.js"></script>
<script src="/static/dev/scripts/oppia-player-0.0.1.js"></script>
<script src="/static/dev/scripts/embedding_tests.js"></script>

<div class="protractor-test-standard">
<h3>Standard embedding of the latest version</h3>
Expand Down
6 changes: 3 additions & 3 deletions static/dev/scripts/embedding_tests_dev_i18n_0.0.1.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<h2>v0.0.1 (unminified)</h2>
<p>For instructions: see the README file in /static/scripts.</p>
<p>For instructions: see the README file in /static/dev/scripts.</p>

<script src="/scripts/oppia-player-0.0.1.js"></script>
<script src="/scripts/embedding_tests.js"></script>
<script src="/static/dev/scripts/oppia-player-0.0.1.js"></script>
<script src="/static/dev/scripts/embedding_tests.js"></script>

<div class="protractor-test-embedded-exploration">
<h3>Standard embedding of the latest version</h3>
Expand Down
8 changes: 4 additions & 4 deletions static/dev/scripts/embedding_tests_jsdelivr_0.0.1.min.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h2>v0.0.1 (minified) from the JSDelivr CDN</h2>
<p>For instructions: see the README file in /static/scripts.</p>
<p>For instructions: see the README file in /static/dev/scripts.</p>
<p>
NB: This set of tests depends on an external file hosted on the JSDelivr CDN.
They will not work if you are offline.
Expand All @@ -10,8 +10,8 @@ <h2>v0.0.1 (minified) from the JSDelivr CDN</h2>
the Oppia iframe to the containing page.
</p>

<script src="/scripts/oppia-player-0.0.1.js"></script>
<script src="/scripts/embedding_tests.js"></script>
<script src="/static/dev/scripts/oppia-player-0.0.1.js"></script>
<script src="/static/dev/scripts/embedding_tests.js"></script>

<div class="protractor-test-standard">
<h3>Standard embedding of the latest version</h3>
Expand All @@ -36,4 +36,4 @@ <h3>ERROR: 404 error</h3>
<div class="protractor-test-invalid-id-deferred">
<h3>ERROR: 404 error with deferred loading</h3>
<oppia oppia-id="fake_id" autoload="false"></oppia>
</div>
</div>